| 264 | } |
| 265 | |
| 266 | bool PhysicsDirect::processDebugLines(const struct SharedMemoryCommand& orgCommand) |
| 267 | { |
| 268 | SharedMemoryCommand command = orgCommand; |
| 269 | |
| 270 | const SharedMemoryStatus& serverCmd = m_data->m_serverStatus; |
| 271 | |
| 272 | do |
| 273 | { |
| 274 | bool hasStatus = m_data->m_commandProcessor->processCommand(command, m_data->m_serverStatus, &m_data->m_bulletStreamDataServerToClient[0], SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE); |
| 275 | |
| 276 | b3Clock clock; |
| 277 | double startTime = clock.getTimeInSeconds(); |
| 278 | double timeOutInSeconds = m_data->m_timeOutInSeconds; |
| 279 | |
| 280 | while ((!hasStatus) && (clock.getTimeInSeconds() - startTime < timeOutInSeconds)) |
| 281 | { |
| 282 | const SharedMemoryStatus* stat = processServerStatus(); |
| 283 | if (stat) |
| 284 | { |
| 285 | hasStatus = true; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | m_data->m_hasStatus = hasStatus; |
| 290 | |
| 291 | if (hasStatus) |
| 292 | { |
| 293 | btAssert(m_data->m_serverStatus.m_type == CMD_DEBUG_LINES_COMPLETED); |
| 294 | |
| 295 | if (m_data->m_verboseOutput) |
| 296 | { |
| 297 | b3Printf("Success receiving %d debug lines", |
| 298 | serverCmd.m_sendDebugLinesArgs.m_numDebugLines); |
| 299 | } |
| 300 | |
| 301 | int numLines = serverCmd.m_sendDebugLinesArgs.m_numDebugLines; |
| 302 | float* linesFrom = |
| 303 | (float*)&m_data->m_bulletStreamDataServerToClient[0]; |
| 304 | float* linesTo = |
| 305 | (float*)(&m_data->m_bulletStreamDataServerToClient[0] + |
| 306 | numLines * 3 * sizeof(float)); |
| 307 | float* linesColor = |
| 308 | (float*)(&m_data->m_bulletStreamDataServerToClient[0] + |
| 309 | 2 * numLines * 3 * sizeof(float)); |
| 310 | |
| 311 | m_data->m_debugLinesFrom.resize(serverCmd.m_sendDebugLinesArgs.m_startingLineIndex + |
| 312 | numLines); |
| 313 | m_data->m_debugLinesTo.resize(serverCmd.m_sendDebugLinesArgs.m_startingLineIndex + |
| 314 | numLines); |
| 315 | m_data->m_debugLinesColor.resize( |
| 316 | serverCmd.m_sendDebugLinesArgs.m_startingLineIndex + numLines); |
| 317 | |
| 318 | for (int i = 0; i < numLines; i++) |
| 319 | { |
| 320 | TmpFloat3 from = CreateTmpFloat3(linesFrom[i * 3], linesFrom[i * 3 + 1], |
| 321 | linesFrom[i * 3 + 2]); |
| 322 | TmpFloat3 to = |
| 323 | CreateTmpFloat3(linesTo[i * 3], linesTo[i * 3 + 1], linesTo[i * 3 + 2]); |
nothing calls this directly
no test coverage detected