| 425 | } |
| 426 | |
| 427 | void 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() ? ¬ifications[0] : 0; |
| 460 | plugin->m_processNotificationsFunc(&context); |
| 461 | } |
| 462 | } |
| 463 | notifications.resize(0); |
| 464 | } |
| 465 | |
| 466 | int b3PluginManager::executePluginCommand(int pluginUniqueId, const b3PluginArguments* arguments) |
| 467 | { |
no test coverage detected