【VR】Leap Motion 官網文檔 LeapRecorder (Leap記錄器)

前言

一天兩篇的節奏很爽啊有木有!好吧,這幾篇都不算長。

Leap Motion API還提供了LeapRecorder(Leap記錄器)類,記錄和播放手部運動的跟蹤結果,並可以逐幀控制。


LeapRecorder Leap記錄器

Defines helper functions for the record/playback mechanism of the HandController.

定義了手部控制器的記錄/播放機制的輔助方法。


class LeapRecorder Leap記錄器類

Maintains a buffer of recorded frames and tracks the state of playback and recording.

維護一個記錄幀的緩存並跟蹤播放和記錄狀態。


Public Functions 公共方法


LeapRecorder() Leap記錄器


Creates a new LeapRecorder object. 創建一個新的Leap記錄器對象。

This doesn’t make sense outside the context of a HandController object.

如果不在手部控制器對象之內,該方法無效。


void AddFrame(Frame frame) 添加幀(Frame 幀)


Serializes a Leap Frame object and adds it to the end of the recording.

序列化一個Leap幀對象並且把它添加到記錄的最後。


Frame GetCurrentFrame() Frame 獲取當前幀


Returns the current frame without advancing the playhead.

返回當前幀並且不向下一幀推進。

This frame could be invalid.

該幀可能失效。


List< Frame > GetFrames() List<Frame> 獲取幀

Deserializes all the recorded frames and returns them in a new list.

反序列化所有記錄的幀並用一個新的List返回它們。


int GetFramesCount() int 獲取幀數


The number of recorded frames.

記錄的幀數。


int GetIndex() int 獲取索引


Returns the playback position.

返回播放位置。


float GetProgress() float 獲取進度


Returns the ratio of the current playback position to the total recording length.

返回當前播放位置與總記錄長度的比例。


void Load(TextAsset text_asset)  載入(TextAsset 文本_資源)


Loads saved frames from a file.

從一個文件裏載入已保存的幀。


Frame NextFrame() Frame 下一幀


Advances the playhead, deserializes the frame, and returns it.

向下推進一幀,反序列化該幀並將其返回。


void Pause() 暫停


Sets the play state to idle.

暫停播放。


void Play() 播放


Sets the play state to playing.

播放。


void Record() 記錄


Sets the play state to recording.

開始記錄。


void Reset() 重置


Discards any recorded frames.

刪除所有已錄製的幀。


string SaveToNewFile() string 保存成新的文件


Saves the recorded frames to a file, overwriting an existing file.

將已錄製好的幀保存成一個文件,覆蓋存在的文件。


void SetDefault() 設置默認


Restores the default behaviors.

復原默認行爲。


void SetIndex(int new_index) 設置索引(int 新的索引)


Sets the playback position to the specified frame count (or the last frame if the specified index is after the last frame.

設置播放位置到指定幀數(如果指定索引在最後一幀之後則設置到最後一幀)。


void Stop() 停止


Sets the play state to idle.

停止播放。


Public Members 公共變量

bool loop bool 循環

Whether to lop back to the beginning when the last recorded frame is played.

記錄的最後一幀播放完畢時是否循環回開始


float speed float 速度

Playback speed.

播放速度


RecorderState state RecorderState 狀態

The current play state.

當前的播放狀態。


————————————————————————————————————————————


更多參考:

【VR】Leap Motion 官網文檔 腳本參考(目錄)


(版權聲明:本篇爲Leap Motion 官網文檔譯文,版權歸Leap Motion 官網所有,圖文內容僅供學習使用。)



發佈了47 篇原創文章 · 獲贊 58 · 訪問量 26萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章