Spatial
"Spatial Layers" are a special datastructure that allow chosen particles to store data, and other particles to query that data efficiently.
This allows inter-particle communication and interactions.
This concept might be complex for beginners, we provided effects that are showing basic usage of "Spatial Layers" in our Tutorials Pack (Effects 140, 141 & 145), available on the PopcornFX Marketplace.
SpatialInsert
This node inserts the input payload into the input spatial layer, at the input "location".
The "location" is used later for querying the payload at nearby locations.
Currently, the "location" is a float3 and queries are made in a 3D-space world.
Input pins |
||
|
|
Spatial Layer object that will receive data |
|
|
Spatial Payload that will send data into the Spatial Layer |
|
|
Location where the spatial payload will be inserted. |
+ all common properties |
||
SpatialLayer
This node declares a spatial layer object.
Like attributes, spatial layer objects are shared between the different layers of the effect.
If another particle layer declares a spatial layer with the same SelfName and CellSize property, both particle layers will access the same spatial layer, allowing them to share data and communicate.
When the spatial layer is declared as global, it is visible from other effects, and the same storage is used while the SelfName and CellSize properties match.
Property |
Type |
Description |
|
|
Name of the Layer |
|
|
Make the Spatial Layer visible from other effects |
|
|
Each cell will have its own data and communication radius. |
|
|
|
Output pins |
||
|
|
Input Value |
+ all common properties except |
||
SpatialPayloadAppend
Much like event payloads, there are spatial payloads. But unlike events, a spatial payload doesn’t need a spatial layer link to append data.
We use spatial payload append nodes to construct the payload we want to insert.
Property |
Type |
Description |
|
|
Name of your payload |
|
|
Type of values you will insert |
|
|
|
|
|
|
Input pins |
||
|
|
(If there’s a previous payload to send) |
|
|
Input Value |
Output pins |
||
|
|
Payload to insert in the Spatial Layer |
+ all common properties |
||
SpatialQuery
Spatial queries are special spatial operations that gives you different results depending on the operation you will make.
It needs a spatial layer, and it will only read data from it.
Property |
Type |
Description |
|
|
Spatial Operation to make.
|
Input pins |
||
|
|
Spatial Layer to read data from |
|
|
Location in the Spatial Layer where it will read data |
|
|
(Only for some Query Types) Query Inner Radius |
|
|
(Only for some Query Types) Query Radius |
|
|
(Only for some Query Types) Weight applied to the data, with |
|
|
(Only for some Query Types) Neighbor index (starts at zero). |
Output pins |
||
|
|
Not-used |
|
|
Output Value |
|
|
(Only for some Query Types) Value if Spatial Query receive data |
+ all common properties |
||