粒子
16 個節點
本頁內容 16
新增粒子迸發
函數加入一次迸發後的場景:在某一時刻從一個球裡向四面八方一次丟擲的粒子,發光的或實心的。撞擊濺出的碎屑,煙花的彈殼。
簽名
新增粒子迸發 -> Particle Scene Description
場景: Particle Scene Description
名稱: 文字
位置: Vector3d
半徑: 數字
數量: 整數
速度: 數字
時間: 數字
壽命: 數字
發光: 真否ParticleSceneDescription AddParticleBurst(
ParticleSceneDescription scene,
string name,
Vector3d position,
double radius = 0.1,
int count = 20000,
double speed = 6,
double time = 0,
double lifetime = 3,
bool glowing = true)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 名稱 | 文字 | — | The emitter's name. |
| 位置 | Vector3d | — | The ball's centre (m). |
| 半徑 | 數字 | 0.1 | Its radius (m). |
| 數量 | 整數 | 20000 | How many particles. |
| 速度 | 數字 | 6 | How fast they are thrown (m/s). |
| 時間 | 數字 | 0 | When (s). |
| 壽命 | 數字 | 3 | How long they last (s). |
| 發光 | 真否 | True | Glowing sparks; off, solid grey debris. |
返回
| 結果 | Particle Scene Description |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
新增粒子發射器
函數加入一個放出粒子的球后的場景,粒子的樣子由自己決定:由太陽照亮的實心小點,或者當“發光”大於 0 時是發光的。
簽名
新增粒子發射器 -> Particle Scene Description
場景: Particle Scene Description
名稱: 文字
位置: Vector3d
半徑: 數字
速率: 數字
速度: Vector3d
散佈: 數字
壽命: 數字
大小: 數字
顏色: 顏色
發光: 數字ParticleSceneDescription AddParticleEmitter(
ParticleSceneDescription scene,
string name,
Vector3d position,
double radius,
double rate,
Vector3d velocity,
double spread,
double lifetime,
double size,
ColorElement colour,
double glow = 0)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 名稱 | 文字 | — | The emitter's name. |
| 位置 | Vector3d | — | Its centre (m). |
| 半徑 | 數字 | — | Its radius (m). |
| 速率 | 數字 | — | Particles born per second. |
| 速度 | Vector3d | — | The velocity they are born with (m/s). |
| 散佈 | 數字 | — | The speed of the random part of that velocity (m/s). |
| 壽命 | 數字 | — | How long a particle lives (s). |
| 大小 | 數字 | — | A particle's radius (m). |
| 顏色 | 顏色 | — | A particle's colour. |
| 發光 | 數字 | 0 | How brightly it glows; 0 is a solid speck. |
返回
| 結果 | Particle Scene Description |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
新增粒子障礙長方體
函數加入一個粒子會從上面彈開的實心長方體後的場景。
簽名
新增粒子障礙長方體 -> Particle Scene Description
場景: Particle Scene Description
名稱: 文字
位置: Vector3d
大小: Vector3dParticleSceneDescription AddParticleObstacleBox(
ParticleSceneDescription scene,
string name,
Vector3d position,
Vector3d size)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 名稱 | 文字 | — | The solid's name. |
| 位置 | Vector3d | — | Its centre (m). |
| 大小 | Vector3d | — | Its size (m) along X, Y and Z. |
返回
| 結果 | Particle Scene Description |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
新增粒子障礙球
函數加入一個粒子會從上面彈開的實心球后的場景。
簽名
新增粒子障礙球 -> Particle Scene Description
場景: Particle Scene Description
名稱: 文字
位置: Vector3d
半徑: 數字ParticleSceneDescription AddParticleObstacleSphere(
ParticleSceneDescription scene,
string name,
Vector3d position,
double radius)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 名稱 | 文字 | — | The solid's name. |
| 位置 | Vector3d | — | Its centre (m). |
| 半徑 | 數字 | — | Its radius (m). |
返回
| 結果 | Particle Scene Description |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
新增降雪
函數加入從一層空氣裡落下的雪後的場景:白色的雪片隨風和湍流飄動,然後落定。雪需要能托住它的空氣:“新建粒子”裡阻力取 6 左右,湍流 0.7 左右,彈性 0。
簽名
新增降雪 -> Particle Scene Description
場景: Particle Scene Description
名稱: 文字
位置: Vector3d
大小: Vector3d
速率: 數字
壽命: 數字ParticleSceneDescription AddSnowfall(
ParticleSceneDescription scene,
string name,
Vector3d position,
Vector3d size,
double rate = 8000,
double lifetime = 9)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 名稱 | 文字 | — | The emitter's name. |
| 位置 | Vector3d | — | The middle of the slab the flakes are born in (m). |
| 大小 | Vector3d | — | The slab's size (m) along X, Y and Z. |
| 速率 | 數字 | 8000 | Flakes per second. |
| 壽命 | 數字 | 9 | How long a flake lasts (s): long enough to reach the ground and lie there a while. |
返回
| 結果 | Particle Scene Description |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
新增火花噴泉
函數加入一個火花噴泉後的場景:從一點丟擲的發光亮線,冷卻時由黃變紅,會落下並彈跳。
簽名
新增火花噴泉 -> Particle Scene Description
場景: Particle Scene Description
名稱: 文字
位置: Vector3d
方向: Vector3d
速率: 數字
散佈: 數字
壽命: 數字ParticleSceneDescription AddSparkFountain(
ParticleSceneDescription scene,
string name,
Vector3d position,
Vector3d direction,
double rate = 30000,
double spread = 1.1,
double lifetime = 2.6)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 名稱 | 文字 | — | The emitter's name. |
| 位置 | Vector3d | — | Where the sparks come from (m). |
| 方向 | Vector3d | — | The velocity they are thrown with (m/s): (0, 0, 6) is straight up, to about two metres. |
| 速率 | 數字 | 30000 | Sparks per second. |
| 散佈 | 數字 | 1.1 | The speed of the random part of their velocity (m/s): what opens the jet into a fountain. |
| 壽命 | 數字 | 2.6 | How long a spark glows (s). |
返回
| 結果 | Particle Scene Description |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
匯出粒子序列圖
函數執行場景,把它的粒子的序列圖寫成帶透明度的 PNG,並在旁邊用文字檔案寫出它的佈局。返回 PNG 的路徑。
簽名
匯出粒子序列圖 -> 文字
場景: Particle Scene Description
路徑: 文字
時長: 數字
眼睛: Vector3d
目標: Vector3d
列數: 整數
行數: 整數
幀大小: 整數
視場角: 數字
顯示發光: 真否string ExportParticleFlipbook(
ParticleSceneDescription scene,
string path,
double duration,
Vector3d eye,
Vector3d target,
int columns = 8,
int rows = 8,
int frameSize = 256,
double fieldOfView = 40,
bool showGlow = true)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 路徑 | 文字 | — | The PNG to write; its folder is created if missing. |
| 時長 | 數字 | — | How long to run (s). |
| 眼睛 | Vector3d | — | Where the camera stands (m). |
| 目標 | Vector3d | — | What it looks at (m). |
| 列數 | 整數 | 8 | Frames in a row. |
| 行數 | 整數 | 8 | Rows of frames. |
| 幀大小 | 整數 | 256 | A frame's width and height in pixels. |
| 視場角 | 數字 | 40 | The camera's vertical field of view in degrees. |
| 顯示發光 | 真否 | True | Give glowing particles an alpha as bright as they are; off, they are colour without alpha, for a game that adds the sheet. The text file says which. |
返回
| 結果 | 文字 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
新建粒子
函數供粒子飛行的空曠空氣,下面是高度為 0 的地面。
簽名
新建粒子 -> Particle Scene Description
重力: 數字
風: Vector3d
阻力: 數字
湍流: 數字
彈性: 數字
地面: 真否
黃昏: 真否ParticleSceneDescription NewParticles(
double gravity = 9.81,
Vector3d wind,
double drag = 0.5,
double turbulence = 0,
double bounce = 0.4,
bool ground = true,
bool dusk = false)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 重力 | 數字 | 9.81 | Gravity (m/s²), pointing down along -Z. |
| 風 | Vector3d | — | The wind (m/s). |
| 阻力 | 數字 | 0.5 | How fast a particle takes the air's velocity (per second): 0 flies free of the air, 0.5 is a spark, 6 drifts like snow. |
| 湍流 | 數字 | 0 | The speed of the air's own swirls (m/s); 0 is still air. |
| 彈性 | 數字 | 0.4 | The share of its speed a particle keeps when it bounces: 0 lands and stays. |
| 地面 | 真否 | True | Whether there is a ground at height 0 to land on. |
| 黃昏 | 真否 | False | Take pictures under a dark sky, against which glowing particles show. |
返回
| 結果 | Particle Scene Description |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
粒子數
函數某一記錄幀裡有多少個活著的粒子。
簽名
粒子數(結果: Particle Result, 幀: 整數) -> 整數
int ParticleCount(ParticleResult result, int frame)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 結果 | Particle Result | — | The run. |
| 幀 | 整數 | — | The recorded frame, from 0. |
返回
| 結果 | 整數 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
粒子序列圖
函數執行場景,在執行期間均勻地取出只有粒子的幀,拼成一張帶透明度的圖片:遊戲用來播放火花的序列圖。幀從左到右、行從上到下排列。實心的粒子是不透明的。發光的粒子只添光、什麼也不遮,所以嚴格說來它是完全沒有透明度的顏色,這樣做出的一張火花圖,在凡是按透明度混合圖片的地方都顯示為一片空白:“顯示發光”給這些光一個與它同樣亮的透明度。
簽名
粒子序列圖 -> Pixel Image
場景: Particle Scene Description
時長: 數字
眼睛: Vector3d
目標: Vector3d
列數: 整數
行數: 整數
幀大小: 整數
視場角: 數字
顯示發光: 真否PixelImage ParticleFlipbook(
ParticleSceneDescription scene,
double duration,
Vector3d eye,
Vector3d target,
int columns = 4,
int rows = 4,
int frameSize = 128,
double fieldOfView = 40,
bool showGlow = true)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 時長 | 數字 | — | How long to run (s). |
| 眼睛 | Vector3d | — | Where the camera stands (m). |
| 目標 | Vector3d | — | What it looks at (m). |
| 列數 | 整數 | 4 | Frames in a row. |
| 行數 | 整數 | 4 | Rows of frames. |
| 幀大小 | 整數 | 128 | A frame's width and height in pixels. |
| 視場角 | 數字 | 40 | The camera's vertical field of view in degrees. |
| 顯示發光 | 真否 | True | Give glowing particles an alpha as bright as they are, so that they show in a viewer and in tools that blend by alpha. Off, they are colour without alpha: exact, for a game that adds the sheet to its picture. |
返回
| 結果 | Pixel Image |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
粒子幀數
函數一次執行記錄了多少幀。
簽名
粒子幀數(result: Particle Result) -> 整數
int ParticleFrameCount(ParticleResult result)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| result | Particle Result | — |
返回
| 結果 | 整數 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
粒子幀時間
函數某一記錄幀的模擬時間(秒)。
簽名
粒子幀時間(result: Particle Result, frame: 整數) -> 數字
double ParticleFrameTime(ParticleResult result, int frame)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| result | Particle Result | — | |
| frame | 整數 | — |
返回
| 結果 | 數字 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
粒子圖片
函數把場景執行一段時間,然後給它拍一張照:地面、固體和粒子。
簽名
粒子圖片 -> Pixel Image
場景: Particle Scene Description
時間: 數字
眼睛: Vector3d
目標: Vector3d
寬度: 整數
高度: 整數
視場角: 數字PixelImage ParticlePicture(
ParticleSceneDescription scene,
double time,
Vector3d eye,
Vector3d target,
int width = 640,
int height = 480,
double fieldOfView = 40)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 時間 | 數字 | — | How long to run before the picture (s). |
| 眼睛 | Vector3d | — | Where the camera stands (m). |
| 目標 | Vector3d | — | What it looks at (m). |
| 寬度 | 整數 | 640 | The picture's width in pixels. |
| 高度 | 整數 | 480 | The picture's height in pixels. |
| 視場角 | 數字 | 40 | The camera's vertical field of view in degrees. |
返回
| 結果 | Pixel Image |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
粒子點
函數某一記錄幀裡粒子的位置(米):每個活著的粒子一個點,三維檢視會把它們畫出來。
簽名
粒子點(結果: Particle Result, 幀: 整數) -> Vector3d 陣列
Vector3d[] ParticlePoints(ParticleResult result, int frame)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 結果 | Particle Result | — | The run. |
| 幀 | 整數 | — | The recorded frame, from 0. |
返回
| 結果 | Vector3d 陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
粒子速度
函數某一記錄幀裡粒子的運動(米/秒):每個活著的粒子一個速度,順序與“粒子點”相同。
簽名
粒子速度(結果: Particle Result, 幀: 整數) -> Vector3d 陣列
Vector3d[] ParticleVelocities(ParticleResult result, int frame)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 結果 | Particle Result | — | The run. |
| 幀 | 整數 | — | The recorded frame, from 0. |
返回
| 結果 | Vector3d 陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬
模擬粒子
函數把場景執行一段時間,並記錄每一幀的粒子,供點節點讀取。十萬個粒子的一幀是 2.4 MB,所以熱鬧的場景要少記幾幀(每隔幾幀保留)。
簽名
模擬粒子 -> Particle Result
場景: Particle Scene Description
時長: 數字
每秒幀數: 數字
每隔幾幀保留: 整數ParticleResult SimulateParticles(
ParticleSceneDescription scene,
double duration = 2,
double framesPerSecond = 30,
int keepEvery = 1)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Particle Scene Description | — | The scene. |
| 時長 | 數字 | 2 | How long to run (s). |
| 每秒幀數 | 數字 | 30 | Frames per second of simulated time. |
| 每隔幾幀保留 | 整數 | 1 | Record every frame (1), every second one (2) and so on; the last frame is always recorded. |
返回
| 結果 | Particle Result |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 粒子
- 所屬包
- 物理模擬