Skip to content

帧同步 Frame Sync

说明 / Overview

帧同步模式下控制仿真推进节奏的接口(仅在 isFrameSync=1 时有效)。
Interfaces for controlling simulation advancement in frame-sync mode (only effective when isFrameSync=1).


Wait

int Wait()

等待并获取当前帧值
Wait and get the current frame value.

此函数用于等待,并返回当前模拟的帧值
This function is used to wait and return the current frame value of the simulation. This function is used to wait and return the current frame value of the simulation.

Returns:

类型 描述
int 返回当前的帧值
Returns the current frame value.

NextFrame

void NextFrame(int frame)

进行下一帧
Proceed to the next frame in a frame-synchronized scene.

此函数用于在帧同步的场景中移动到下一帧
This function is used to move to the next frame in a frame-synchronized scene. This function is used to move to the next frame in a frame-synchronized scene.

Parameters:

名称 类型 描述 默认
frame int 当前帧的值
The value of the current frame.

Pause

int Pause()

暂停,用于非帧同步调试
Pause, used for non frame synchronized debugging.

此函数用于暂停当前运行的案例,通常在非帧同步的调试过程中使用
This function is used to pause the currently running case, typically in non-frame synchronized debugging scenarios. This function is used to pause the currently running case, typically in non-frame synchronized debugging scenarios.

Returns:

类型 描述
int 返回整数状态码
Returns an integer status code.

Continue

int Continue()

继续,用于非帧同步调试
Continue, used for non frame synchronized debugging.

此函数用于在暂停后继续运行当前案例,通常在非帧同步的调试过程中使用
This function is used to resume running the current case after a pause, typically in non-frame synchronized debugging scenarios. This function is used to resume running the current case after a pause, typically in non-frame synchronized debugging scenarios.

Returns:

类型 描述
int 返回整数状态码
Returns an integer status code.

SetFrameCB

bool SetFrameCB(void(*FrameStart)(int frame), void(*FrameEnd)(int frame))

仿真场景中每帧的回调函数
Callback function for each frame in a simulation scene.

此函数用于注册在每帧开始和结束时调用的回调函数
This function is used to register callback functions that are called at the beginning and end of each frame in a simulation. This function is used to register callback functions that are called at the beginning and end of each frame in a simulation.

Parameters:

名称 类型 描述 默认
FrameStart void(*)(int frame) 每帧开始时调用的回调函数
Callback function called at the beginning of each frame.
FrameEnd void(*)(int frame) 每帧结束时调用的回调函数
Callback function called at the end of each frame.

Returns:

类型 描述
bool 成功注册返回true,否则返回false
Returns true if successfully registered, false otherwise.