模擬會話
29 個節點
本頁內容 29
新增物體
函數向正在執行的場景加入一個物體。
簽名
新增物體
Simulation Session: Simulation Session
物體: Body Descriptionvoid AddBody(
SimulationSession Simulation Session,
BodyDescription body)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | Body Description | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
推進
函數把模擬推進一段模擬時間(秒),按耦合步進行。
簽名
推進(Simulation Session: Simulation Session, 秒數: 數字)
void Advance(
SimulationSession Simulation Session,
double seconds)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 秒數 | 數字 | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
全部物體網格
函數此刻所有物體的表面合成一個網格,地面不包括在內。
簽名
全部物體網格(Simulation Session: Simulation Session) -> Streamed Vertex Mesh Data
StreamedVertexMeshData BodiesMesh(SimulationSession Simulation Session)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — |
返回
| 結果 | Streamed Vertex Mesh Data |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
物體名稱
函數此刻各物體的名稱,按建立順序排列。
簽名
物體名稱(Simulation Session: Simulation Session) -> 文字陣列
string[] BodyNames(SimulationSession Simulation Session)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — |
返回
| 結果 | 文字陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
物體位置
函數一個物體此刻的位置(米)。
簽名
物體位置 -> Vector3d
Simulation Session: Simulation Session
物體: 文字Vector3d BodyPosition(
SimulationSession Simulation Session,
string body)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | 文字 | — |
返回
| 結果 | Vector3d |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
物體朝向
函數一個物體此刻的朝向。
簽名
物體朝向 -> Quaterniond
Simulation Session: Simulation Session
物體: 文字Quaterniond BodyRotation(
SimulationSession Simulation Session,
string body)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | 文字 | — |
返回
| 結果 | Quaterniond |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
物體速度
函數一個物體此刻的速度(米/秒)。
簽名
物體速度 -> Vector3d
Simulation Session: Simulation Session
物體: 文字Vector3d BodyVelocity(
SimulationSession Simulation Session,
string body)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | 文字 | — |
返回
| 結果 | Vector3d |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
捕獲幀
函數把此刻的狀態取為一個不可變的幀,供函數式節點使用或儲存下來。
簽名
捕獲幀 -> Simulation Frame
Simulation Session: Simulation Session
記錄水體: 真否SimulationFrame Capture(
SimulationSession Simulation Session,
bool recordWater = true)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 記錄水體 | 真否 | True |
返回
| 結果 | Simulation Frame |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
布料網格
函數一塊布料此刻的表面,用於渲染。
簽名
布料網格 -> Streamed Vertex Mesh Data
Simulation Session: Simulation Session
布料: 文字StreamedVertexMeshData ClothMesh(
SimulationSession Simulation Session,
string cloth)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 布料 | 文字 | — |
返回
| 結果 | Streamed Vertex Mesh Data |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
引爆
函數此刻在某個位置(米)引爆一包 TNT 炸藥。
簽名
引爆
Simulation Session: Simulation Session
位置: Vector3d
TNT(千克): 數字void Detonate(
SimulationSession Simulation Session,
Vector3d position,
double tntKg)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 位置 | Vector3d | — | 位置(米)。 |
| TNT(千克) | 數字 | — | 炸藥量(千克 TNT 當量)。 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
結束會話
函數結束會話,釋放引擎的狀態。
簽名
結束會話(Simulation Session: Simulation Session)
void Dispose(SimulationSession Simulation Session)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
服裝網格
函數一件服裝此刻的整個表面,合為一個網格:新增服裝為它做出的每塊衣片。
簽名
服裝網格 -> Streamed Vertex Mesh Data
Simulation Session: Simulation Session
服裝: 文字StreamedVertexMeshData GarmentMesh(
SimulationSession Simulation Session,
string garment)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 服裝 | 文字 | — | The garment's name. |
返回
| 結果 | Streamed Vertex Mesh Data |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
幀
函數“步進一幀”已經推進的幀數。
簽名
幀(Simulation Session: Simulation Session) -> 整數
int Frame(SimulationSession Simulation Session)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — |
返回
| 結果 | 整數 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
場景
函數會話開始時所用的場景描述(執行中所做的改變不在其中)。
簽名
場景(Simulation Session: Simulation Session) -> Scene Description
SceneDescription Scene(SimulationSession Simulation Session)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — |
返回
| 結果 | Scene Description |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
時間
函數模擬時間(秒)。
簽名
時間(Simulation Session: Simulation Session) -> 數字
double Time(SimulationSession Simulation Session)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — |
返回
| 結果 | 數字 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
移動運動學物體
函數在下一個耦合步內把一個運動學物體移到某個位置(米),它碰到的一切都會被它以其速度推動。
簽名
移動運動學物體
Simulation Session: Simulation Session
物體: 文字
位置: Vector3dvoid MoveKinematic(
SimulationSession Simulation Session,
string body,
Vector3d position)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | 文字 | — | |
| 位置 | Vector3d | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
移動運動學物體位姿
函數在下一個耦合步內把一個運動學物體移到某個位置(米)和朝向:由圖揮動的錘子、一扇門、一支槳。它碰到的一切都會被它以其線速度和角速度推動。
簽名
移動運動學物體位姿
Simulation Session: Simulation Session
物體: 文字
位置: Vector3d
旋轉: Quaterniondvoid MoveKinematicPose(
SimulationSession Simulation Session,
string body,
Vector3d position,
Quaterniond rotation)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | 文字 | — | |
| 位置 | Vector3d | — | |
| 旋轉 | Quaterniond | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
推動
函數給一個動態物體施加一個衝量(牛·秒)。
簽名
推動
Simulation Session: Simulation Session
物體: 文字
衝量: Vector3dvoid Push(
SimulationSession Simulation Session,
string body,
Vector3d impulse)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | 文字 | — | |
| 衝量 | Vector3d | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
釋放
函數讓一個靜態或運動學物體變為動態:它開始下落並能被推動。
簽名
釋放(Simulation Session: Simulation Session, 物體: 文字)
void Release(SimulationSession Simulation Session, string body)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | 文字 | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
移除物體
函數把一個物體從正在執行的場景中移除。
簽名
移除物體(Simulation Session: Simulation Session, 物體: 文字)
void RemoveBody(
SimulationSession Simulation Session,
string body)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 物體 | 文字 | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
報告
函數引擎關於場景中有什麼、每個求解器耗時多少的報告。
簽名
報告(Simulation Session: Simulation Session) -> 文字
string Report(SimulationSession Simulation Session)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — |
返回
| 結果 | 文字 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
儲存預覽圖
函數在處理器上(無需顯示卡)渲染此刻的場景並儲存為 PNG;返回檔案路徑。
簽名
儲存預覽圖 -> 文字
Simulation Session: Simulation Session
路徑: 文字
相機位置: Vector3d
目標點: Vector3d
寬度: 整數
高度: 整數string SavePreview(
SimulationSession Simulation Session,
string path,
Vector3d eye,
Vector3d target,
int width = 960,
int height = 540)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 路徑 | 文字 | — | PNG 檔案。 |
| 相機位置 | Vector3d | — | 相機位置(米)。 |
| 目標點 | Vector3d | — | 相機注視的點(米)。 |
| 寬度 | 整數 | 960 | 影像寬度(像素)。 |
| 高度 | 整數 | 540 | 影像高度(像素)。 |
返回
| 結果 | 文字 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
設定重力
函數改變重力(米/平方秒)。
簽名
設定重力(Simulation Session: Simulation Session, 重力: Vector3d)
void SetGravity(
SimulationSession Simulation Session,
Vector3d gravity)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 重力 | Vector3d | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
設定風
函數改變穩定風(米/秒)及其陣風(米/秒)。
簽名
設定風
Simulation Session: Simulation Session
速度: Vector3d
陣風: 數字void SetWind(
SimulationSession Simulation Session,
Vector3d velocity,
double gusts = 0)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 速度 | Vector3d | — | |
| 陣風 | 數字 | 0 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
步進一幀
函數按某個幀率把模擬推進一幀,與“模擬”記錄一次執行的方式相同。
簽名
步進一幀(Simulation Session: Simulation Session, 每秒幀數: 數字)
void StepFrame(
SimulationSession Simulation Session,
double framesPerSecond = 30)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 每秒幀數 | 數字 | 30 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
取出事件
函數自上次呼叫以來場景中各觸發器的事件,最早的在前:過程式圖在這裡對接觸、閾值和計時作出反應。
簽名
取出事件(Simulation Session: Simulation Session) -> Simulation Event 陣列
SimulationEvent[] TakeEvents(SimulationSession Simulation Session)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — |
返回
| 結果 | Simulation Event 陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
解除布料固定
函數鬆開一塊布料被固定的頂點。
簽名
解除布料固定(Simulation Session: Simulation Session, 布料: 文字)
void UnpinCloth(
SimulationSession Simulation Session,
string cloth)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 布料 | 文字 | — |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
水體粒子
函數一個水體的粒子此刻的位置(米)。
簽名
水體粒子 -> Vector3d 陣列
Simulation Session: Simulation Session
水體: 文字Vector3d[] WaterParticles(
SimulationSession Simulation Session,
string water)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| Simulation Session | Simulation Session | — | |
| 水體 | 文字 | — |
返回
| 結果 | Vector3d 陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 事件 例程 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬
開始會話
函數從一個場景描述開始一個會話。
簽名
開始會話 -> Simulation Session
場景: Scene Description
執行緒數: 整數SimulationSession Start(SceneDescription scene, int threads = 0)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 場景 | Scene Description | — | 場景。 |
| 執行緒數 | 整數 | 0 | 工作執行緒數;為 0 時使用引擎的共享執行緒池。結果與它無關。 |
返回
| 結果 | Simulation Session |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 模擬會話
- 所屬包
- 物理模擬