MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / reportNotifications

Method reportNotifications

examples/SharedMemory/b3PluginManager.cpp:427–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void b3PluginManager::reportNotifications()
428{
429 b3AlignedObjectArray<b3Notification>& notifications = m_data->m_notifications[m_data->m_activeNotificationsBufferIndex];
430 if (notifications.size() == 0)
431 {
432 return;
433 }
434
435 // Swap notification buffers.
436 m_data->m_activeNotificationsBufferIndex = 1 - m_data->m_activeNotificationsBufferIndex;
437
438 for (int i = 0; i < m_data->m_pluginMap.size(); i++)
439 {
440 int* pluginUidPtr = m_data->m_pluginMap.getAtIndex(i);
441 b3PluginHandle* plugin = 0;
442
443 if (pluginUidPtr)
444 {
445 int pluginUid = *pluginUidPtr;
446 plugin = m_data->m_plugins.getHandle(pluginUid);
447 }
448 else
449 {
450 continue;
451 }
452
453 if (plugin->m_processNotificationsFunc)
454 {
455 b3PluginContext context = {0};
456 context.m_userPointer = plugin->m_userPointer;
457 context.m_physClient = (b3PhysicsClientHandle)m_data->m_physicsDirect;
458 context.m_numNotifications = notifications.size();
459 context.m_notifications = notifications.size() ? &notifications[0] : 0;
460 plugin->m_processNotificationsFunc(&context);
461 }
462 }
463 notifications.resize(0);
464}
465
466int b3PluginManager::executePluginCommand(int pluginUniqueId, const b3PluginArguments* arguments)
467{

Callers 2

submitClientCommandMethod · 0.45
MotionThreadFuncFunction · 0.45

Calls 4

sizeMethod · 0.45
getAtIndexMethod · 0.45
getHandleMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected