Difference between revisions of "Lua API:Simulation"
m (Constants) |
(All the things!) |
||
Line 3: | Line 3: | ||
== Methods == | == Methods == | ||
− | === simulation. | + | === simulation.adjustCoords === |
− | + | type sim.adjustCoords() | |
− | + | Does something | |
− | + | ||
+ | === simulation.airMode === | ||
+ | type sim.airMode() | ||
+ | Does something | ||
+ | |||
+ | === simulation.ambientAirTemp === | ||
+ | type sim.ambientAirTemp() | ||
+ | Does something | ||
+ | |||
+ | === simulation.ambientHeat === | ||
+ | type sim.ambientHeat() | ||
+ | Does something | ||
+ | |||
+ | === simulation.clearSim === | ||
+ | type sim.clearSim() | ||
+ | Does something | ||
+ | |||
+ | === simulation.createBox === | ||
+ | type sim.createBox() | ||
+ | Does something | ||
+ | |||
+ | === simulation.createLine === | ||
+ | type sim.createLine() | ||
+ | Does something | ||
+ | |||
+ | === simulation.createParts === | ||
+ | type sim.createParts() | ||
+ | Does something | ||
+ | |||
+ | === simulation.createWallBox === | ||
+ | type sim.createWallBox() | ||
+ | Does something | ||
+ | |||
+ | === simulation.createWallLine === | ||
+ | type sim.createWallLine() | ||
+ | Does something | ||
+ | |||
+ | === simulation.createWalls === | ||
+ | type sim.createWalls() | ||
+ | Does something | ||
+ | |||
+ | === simulation.decoBox === | ||
+ | type sim.decoBox() | ||
+ | Does something | ||
+ | |||
+ | === simulation.decoBrush === | ||
+ | type sim.decoBrush() | ||
+ | Does something | ||
+ | |||
+ | === simulation.decoColor === | ||
+ | type sim.decoColor() | ||
+ | Does something | ||
+ | |||
+ | === simulation.decoColour === | ||
+ | type sim.decoColour() | ||
+ | Does something | ||
+ | |||
+ | === simulation.decoLine === | ||
+ | type sim.decoLine() | ||
+ | Does something | ||
+ | |||
+ | === simulation.edgeMode === | ||
+ | type sim.edgeMode() | ||
+ | Does something | ||
+ | |||
+ | === simulation.elementCount === | ||
+ | type sim.elementCount() | ||
+ | Does something | ||
+ | |||
+ | === simulation.floodParts === | ||
+ | type sim.floodParts() | ||
+ | Does something | ||
+ | |||
+ | === simulation.floodWalls === | ||
+ | type sim.floodWalls() | ||
+ | Does something | ||
+ | |||
+ | === simulation.getSaveID === | ||
+ | type sim.getSaveID() | ||
+ | Does something | ||
+ | |||
+ | === simulation.gravMap === | ||
+ | type sim.gravMap() | ||
+ | Does something | ||
+ | |||
+ | === simulation.gravityGrid === | ||
+ | type sim.gravityGrid() | ||
+ | Does something | ||
+ | |||
+ | === simulation.gravityMode === | ||
+ | type sim.gravityMode() | ||
+ | Does something | ||
+ | |||
+ | === simulation.loadSave === | ||
+ | type sim.loadSave() | ||
+ | Does something | ||
+ | |||
+ | === simulation.loadStamp === | ||
+ | type sim.loadStamp() | ||
+ | Does something | ||
+ | |||
+ | === simulation.neighbors === | ||
+ | type sim.neighbors() | ||
+ | Does something | ||
+ | |||
+ | === simulation.neighbours === | ||
+ | type sim.neighbours() | ||
+ | Does something | ||
− | === simulation.partChangeType === | + | === simulation.partChangeType === |
nil sim.partChangeType(number index, number type) | nil sim.partChangeType(number index, number type) | ||
Reliably change the type of a particle, this method avoids the side effects created by changing the type directly with the "partProperty" method. | Reliably change the type of a particle, this method avoids the side effects created by changing the type directly with the "partProperty" method. | ||
− | === simulation.partKill=== | + | === simulation.partCreate === |
+ | type sim.partCreate() | ||
+ | Does something | ||
+ | |||
+ | === simulation.partID === | ||
+ | number sim.partID(number x, number y) | ||
+ | Get the index of a particle at the specified position | ||
+ | |||
+ | === simulation.partKill === | ||
nil sim.partKill(number index) | nil sim.partKill(number index) | ||
nil sim.partKill(number x, number y) | nil sim.partKill(number x, number y) | ||
Reliably delete a particle at a specified index or location, this method avoids the side effects created by changing the type to 0/DEFAULT_PT_NONE with the "partProperty" method | Reliably delete a particle at a specified index or location, this method avoids the side effects created by changing the type to 0/DEFAULT_PT_NONE with the "partProperty" method | ||
+ | |||
+ | === simulation.partNeighbors === | ||
+ | number ... sim.partNeighbours(number x, number y, number radius, [number type]) | ||
+ | Returns a list of particles indexes that neighbour the given coordinates that matches the given type (if it is specified) The resulting list does not contain the "origin particle" | ||
+ | |||
+ | === simulation.partNeighbours === | ||
+ | type sim.partNeighbours() | ||
+ | Does something | ||
+ | |||
+ | === simulation.partPosition === | ||
+ | number x, number y sim.partPosition(number index) | ||
+ | Get the location of the particle at the specified index | ||
=== simulation.partProperty === | === simulation.partProperty === | ||
Line 26: | Line 153: | ||
The "field" may be a field name or field ID, see [bottom of page] for more information | The "field" may be a field name or field ID, see [bottom of page] for more information | ||
− | === simulation. | + | === simulation.parts === |
− | + | type sim.parts() | |
− | + | Does something | |
+ | |||
+ | === simulation.pmap === | ||
+ | type sim.pmap() | ||
+ | Does something | ||
+ | |||
+ | === simulation.pressure === | ||
+ | type sim.pressure() | ||
+ | Does something | ||
+ | |||
+ | === simulation.prettyPowders === | ||
+ | type sim.prettyPowders() | ||
+ | Does something | ||
+ | |||
+ | === simulation.resetPressure === | ||
+ | type sim.resetPressure() | ||
+ | Does something | ||
+ | |||
+ | === simulation.resetTemp === | ||
+ | type sim.resetTemp() | ||
+ | Does something | ||
− | === simulation. | + | === simulation.saveStamp === |
− | + | type sim.saveStamp() | |
− | + | Does something | |
− | === simulation. | + | === simulation.toolBox === |
− | + | type sim.toolBox() | |
+ | Does something | ||
− | === simulation. | + | === simulation.toolBrush === |
+ | type sim.toolBrush() | ||
+ | Does something | ||
− | === simulation. | + | === simulation.toolLine === |
+ | type sim.toolLine() | ||
+ | Does something | ||
=== simulation.velocityX === | === simulation.velocityX === | ||
+ | type sim.velocityX() | ||
+ | Does something | ||
=== simulation.velocityY === | === simulation.velocityY === | ||
+ | type sim.velocityY() | ||
+ | Does something | ||
− | === simulation. | + | === simulation.waterEqualisation === |
+ | type sim.waterEqualisation() | ||
+ | Does something | ||
+ | |||
+ | === simulation.waterEqualization === | ||
+ | type sim.waterEqualization() | ||
+ | Does something | ||
== Constants == | == Constants == |
Revision as of 20:45, 29 September 2013
The Simulation API allows for modifying the state and properties of particles, air and gravity
Contents
- 1 Methods
- 1.1 simulation.adjustCoords
- 1.2 simulation.airMode
- 1.3 simulation.ambientAirTemp
- 1.4 simulation.ambientHeat
- 1.5 simulation.clearSim
- 1.6 simulation.createBox
- 1.7 simulation.createLine
- 1.8 simulation.createParts
- 1.9 simulation.createWallBox
- 1.10 simulation.createWallLine
- 1.11 simulation.createWalls
- 1.12 simulation.decoBox
- 1.13 simulation.decoBrush
- 1.14 simulation.decoColor
- 1.15 simulation.decoColour
- 1.16 simulation.decoLine
- 1.17 simulation.edgeMode
- 1.18 simulation.elementCount
- 1.19 simulation.floodParts
- 1.20 simulation.floodWalls
- 1.21 simulation.getSaveID
- 1.22 simulation.gravMap
- 1.23 simulation.gravityGrid
- 1.24 simulation.gravityMode
- 1.25 simulation.loadSave
- 1.26 simulation.loadStamp
- 1.27 simulation.neighbors
- 1.28 simulation.neighbours
- 1.29 simulation.partChangeType
- 1.30 simulation.partCreate
- 1.31 simulation.partID
- 1.32 simulation.partKill
- 1.33 simulation.partNeighbors
- 1.34 simulation.partNeighbours
- 1.35 simulation.partPosition
- 1.36 simulation.partProperty
- 1.37 simulation.parts
- 1.38 simulation.pmap
- 1.39 simulation.pressure
- 1.40 simulation.prettyPowders
- 1.41 simulation.resetPressure
- 1.42 simulation.resetTemp
- 1.43 simulation.saveStamp
- 1.44 simulation.toolBox
- 1.45 simulation.toolBrush
- 1.46 simulation.toolLine
- 1.47 simulation.velocityX
- 1.48 simulation.velocityY
- 1.49 simulation.waterEqualisation
- 1.50 simulation.waterEqualization
- 2 Constants
Methods
simulation.adjustCoords
type sim.adjustCoords()
Does something
simulation.airMode
type sim.airMode()
Does something
simulation.ambientAirTemp
type sim.ambientAirTemp()
Does something
simulation.ambientHeat
type sim.ambientHeat()
Does something
simulation.clearSim
type sim.clearSim()
Does something
simulation.createBox
type sim.createBox()
Does something
simulation.createLine
type sim.createLine()
Does something
simulation.createParts
type sim.createParts()
Does something
simulation.createWallBox
type sim.createWallBox()
Does something
simulation.createWallLine
type sim.createWallLine()
Does something
simulation.createWalls
type sim.createWalls()
Does something
simulation.decoBox
type sim.decoBox()
Does something
simulation.decoBrush
type sim.decoBrush()
Does something
simulation.decoColor
type sim.decoColor()
Does something
simulation.decoColour
type sim.decoColour()
Does something
simulation.decoLine
type sim.decoLine()
Does something
simulation.edgeMode
type sim.edgeMode()
Does something
simulation.elementCount
type sim.elementCount()
Does something
simulation.floodParts
type sim.floodParts()
Does something
simulation.floodWalls
type sim.floodWalls()
Does something
simulation.getSaveID
type sim.getSaveID()
Does something
simulation.gravMap
type sim.gravMap()
Does something
simulation.gravityGrid
type sim.gravityGrid()
Does something
simulation.gravityMode
type sim.gravityMode()
Does something
simulation.loadSave
type sim.loadSave()
Does something
simulation.loadStamp
type sim.loadStamp()
Does something
simulation.neighbors
type sim.neighbors()
Does something
simulation.neighbours
type sim.neighbours()
Does something
simulation.partChangeType
nil sim.partChangeType(number index, number type)
Reliably change the type of a particle, this method avoids the side effects created by changing the type directly with the "partProperty" method.
simulation.partCreate
type sim.partCreate()
Does something
simulation.partID
number sim.partID(number x, number y)
Get the index of a particle at the specified position
simulation.partKill
nil sim.partKill(number index) nil sim.partKill(number x, number y)
Reliably delete a particle at a specified index or location, this method avoids the side effects created by changing the type to 0/DEFAULT_PT_NONE with the "partProperty" method
simulation.partNeighbors
number ... sim.partNeighbours(number x, number y, number radius, [number type])
Returns a list of particles indexes that neighbour the given coordinates that matches the given type (if it is specified) The resulting list does not contain the "origin particle"
simulation.partNeighbours
type sim.partNeighbours()
Does something
simulation.partPosition
number x, number y sim.partPosition(number index)
Get the location of the particle at the specified index
simulation.partProperty
nil sim.partProperty(number index, object field, object value)
Set the property value on a particle specified by index
object sim.partProperty(number index, object field)
Get the property value on a particle specified by the index
The "field" may be a field name or field ID, see [bottom of page] for more information
simulation.parts
type sim.parts()
Does something
simulation.pmap
type sim.pmap()
Does something
simulation.pressure
type sim.pressure()
Does something
simulation.prettyPowders
type sim.prettyPowders()
Does something
simulation.resetPressure
type sim.resetPressure()
Does something
simulation.resetTemp
type sim.resetTemp()
Does something
simulation.saveStamp
type sim.saveStamp()
Does something
simulation.toolBox
type sim.toolBox()
Does something
simulation.toolBrush
type sim.toolBrush()
Does something
simulation.toolLine
type sim.toolLine()
Does something
simulation.velocityX
type sim.velocityX()
Does something
simulation.velocityY
type sim.velocityY()
Does something
simulation.waterEqualisation
type sim.waterEqualisation()
Does something
simulation.waterEqualization
type sim.waterEqualization()
Does something
Constants
Any of these constants can be accessed with simulation.<constant name here>
DECO
- DECO_DIVIDE
- DECO_SMUDGE
- DECO_ADD
- DECO_SUBTRACT
- DECO_CLEAR
- DECO_DRAW
- DECO_MULTIPLY
FIELD
- FIELD_DCOLOUR
- FIELD_Y
- FIELD_TEMP
- FIELD_TYPE
- FIELD_VY
- FIELD_X
- FIELD_TMP2
- FIELD_TMP
- FIELD_FLAGS
- FIELD_VX
- FIELD_CTYPE
- FIELD_LIFE
MAX
- MAX_TEMP
MIN
- MIN_TEMP
NUM
- NUM_PARTS
PT
- PT_NUM
R
- R_TEMP
TOOL
- TOOL_VAC
- TOOL_AIR
- TOOL_NGRV
- TOOL_PGRV
- TOOL_HEAT
- TOOL_WIND
- TOOL_COOL
Uncategorized
- YRES
- XRES