Implement an Update Function

Demonstrates how to receive regular updates every frame.

A plugin may wish to be notified regularly of updates. To do this it should register a callback using VRAddCallbackUpdate.

Lua plugins may use __registerCallback to register themselves with the timestep function which is called every frame.

static void myUpdate(double deltaTime, void* userData)
{
  //perform an operation regularly  
}

PLUGIN_ENTRY_POINT int VRTREE_APIENTRY VRPInit()
{
  VRPLUGIN_LOADVRTREE;
  VRAddCallbackUpdate(&myUpdate, NULL);
}
local function myTimestep()

end

local function init()
  -- existing initialisation code...

  __registerCallback("onTimestepEvent", myTimestep)
end


No Results.

Getting StartedArchitectureBest PracticesHow ToAdvanced TopicsChangelogvrtreevrtree_cppvtCoreCoreForeign Function InterfaceMetanodesMigrationsObserversPropertiesSettingsTreeUtilitiesAPI DefinitionsVR ExchangePluginsLua API