元編程參考文件

海岸會話

19 個節點

本頁內容 19

推進

函數

把水推進一段模擬時間(秒),每步不超過六十分之一秒。

簽名
推進(Shore Session: Shore Session, seconds: 數字)
void Advance(ShoreSession Shore Session, double seconds)

參數

名稱型別預設值說明
Shore SessionShore Session—
seconds數字—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

物體位置

函數

一個物體此刻的位置(米)。

簽名
物體位置(Shore Session: Shore Session, 名稱: 文字) -> Vector3d
Vector3d BodyPosition(ShoreSession Shore Session, string name)

參數

名稱型別預設值說明
Shore SessionShore Session—
名稱文字—Its name.

返回

結果Vector3d
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

物體朝向

函數

一個物體此刻的朝向。

簽名
物體朝向 -> Quaterniond
    Shore Session: Shore Session
    名稱: 文字
Quaterniond BodyRotation(
    ShoreSession Shore Session,
    string name)

參數

名稱型別預設值說明
Shore SessionShore Session—
名稱文字—Its name.

返回

結果Quaterniond
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

物體速度

函數

一個物體此刻的速度(米/秒)。

簽名
物體速度(Shore Session: Shore Session, 名稱: 文字) -> Vector3d
Vector3d BodyVelocity(ShoreSession Shore Session, string name)

參數

名稱型別預設值說明
Shore SessionShore Session—
名稱文字—Its name.

返回

結果Vector3d
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

捕獲物體

函數

物體此刻的樣子,取為一個幀,三維檢視會把它畫出來。

簽名
捕獲物體(Shore Session: Shore Session) -> Simulation Frame
SimulationFrame CaptureBodies(ShoreSession Shore Session)

參數

名稱型別預設值說明
Shore SessionShore Session—

返回

結果Simulation Frame
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

結束會話

函數

結束會話,把它在顯示卡上的記憶體還回去。

簽名
結束會話(Shore Session: Shore Session)
void Dispose(ShoreSession Shore Session)

參數

名稱型別預設值說明
Shore SessionShore Session—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

幀

函數

How many frames Step Frame has stepped.

簽名
幀(Shore Session: Shore Session) -> 整數
int Frame(ShoreSession Shore Session)

參數

名稱型別預設值說明
Shore SessionShore Session—

返回

結果整數
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

場景

函數

The scene the session started from.

簽名
場景(Shore Session: Shore Session) -> Shore Scene Description
ShoreSceneDescription Scene(ShoreSession Shore Session)

參數

名稱型別預設值說明
Shore SessionShore Session—

返回

結果Shore Scene Description
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

時間

函數

Simulated time (s).

簽名
時間(Shore Session: Shore Session) -> 數字
double Time(ShoreSession Shore Session)

參數

名稱型別預設值說明
Shore SessionShore Session—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

推動物體

函數

在一個物體的中心推它一下:一個衝量(牛·秒),即它的質量乘以速度的變化。一條被推下沙灘的小船,一陣風。

簽名
推動物體
    Shore Session: Shore Session
    名稱: 文字
    衝量: Vector3d
void PushBody(
    ShoreSession Shore Session,
    string name,
    Vector3d impulse)

參數

名稱型別預設值說明
Shore SessionShore Session—
名稱文字—The body's name.
衝量Vector3d—The impulse (N·s).
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

渲染

函數

海岸此刻的一張圖片。

簽名
渲染 -> Pixel Image
    Shore Session: Shore Session
    眼睛: Vector3d
    目標: Vector3d
    寬度: 整數
    高度: 整數
    視場角: 數字
PixelImage Render(
    ShoreSession Shore Session,
    Vector3d eye,
    Vector3d target,
    int width = 640,
    int height = 480,
    double fieldOfView = 40)

參數

名稱型別預設值說明
Shore SessionShore Session—
眼睛Vector3d—Where the camera stands (m).
目標Vector3d—What it looks at (m).
寬度整數640The picture's width in pixels.
高度整數480The picture's height in pixels.
視場角數字40The camera's vertical field of view in degrees.

返回

結果Pixel Image
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

設定海

函數

把湧進來的海換成另一個海洋場景的海:風在增強、轉向或停息。已經在海岸上的波浪繼續走,新的跟在它們後面進來。

簽名
設定海
    Shore Session: Shore Session
    海: Ocean Scene Description
void SetSea(
    ShoreSession Shore Session,
    OceanSceneDescription sea)

參數

名稱型別預設值說明
Shore SessionShore Session—
海Ocean Scene Description—The sea whose wind is taken.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

設定波浪

函數

改變從海上湧來的長湧:風暴漸起,或漸息。

簽名
設定波浪(Shore Session: Shore Session, 振幅: 數字, 週期: 數字)
void SetWaves(
    ShoreSession Shore Session,
    double amplitude,
    double period = 8)

參數

名稱型別預設值說明
Shore SessionShore Session—
振幅數字—Its height from its middle to its crest (m).
週期數字8Its period (s).
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

步進一幀

函數

按某個幀率把水推進一幀。

簽名
步進一幀(Shore Session: Shore Session, framesPerSecond: 數字)
void StepFrame(
    ShoreSession Shore Session,
    double framesPerSecond = 30)

參數

名稱型別預設值說明
Shore SessionShore Session—
framesPerSecond數字30
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

表面

函數

此刻的水面,作為一個蓋在有水單元上的網格。

簽名
表面 -> Streamed Vertex Mesh Data
    Shore Session: Shore Session
    每隔幾格: 整數
StreamedVertexMeshData Surface(
    ShoreSession Shore Session,
    int every = 1)

參數

名稱型別預設值說明
Shore SessionShore Session—
每隔幾格整數1Use every cell (1), every second one (2) and so on.

返回

結果Streamed Vertex Mesh Data
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

取出事件

函數

自上次呼叫以來場景的觸發器做了什麼,最早的在前:每觸發一次就是一個事件,帶著它的時間、地點和所涉及的物體。沒有觸發過,或者海岸沒有觸發器時為空。

簽名
取出事件(Shore Session: Shore Session) -> Simulation Event 陣列
SimulationEvent[] TakeEvents(ShoreSession Shore Session)

參數

名稱型別預設值說明
Shore SessionShore Session—

返回

結果Simulation Event 陣列
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

水深

函數

此刻某一點的水有多深(米):沙是乾的地方為 0。

簽名
水深(Shore Session: Shore Session, 位置: Vector3d) -> 數字
double WaterDepth(ShoreSession Shore Session, Vector3d position)

參數

名稱型別預設值說明
Shore SessionShore Session—
位置Vector3d—The point; its Z is not used.

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

水量

函數

此刻範圍內有多少水(立方米)。

簽名
水量(Shore Session: Shore Session) -> 數字
double WaterVolume(ShoreSession Shore Session)

參數

名稱型別預設值說明
Shore SessionShore Session—

返回

結果數字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬

開始海岸會話

函數

從一個海岸場景開始一個會話。

簽名
開始海岸會話(場景: Shore Scene Description) -> Shore Session
ShoreSession Start(ShoreSceneDescription scene)

參數

名稱型別預設值說明
場景Shore Scene Description—The shore.

返回

結果Shore Session
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
海岸會話
所屬包
物理模擬