| 402 | } |
| 403 | |
| 404 | bool PhysicsDirect::processOverlappingObjects(const struct SharedMemoryCommand& orgCommand) |
| 405 | { |
| 406 | SharedMemoryCommand command = orgCommand; |
| 407 | |
| 408 | const SharedMemoryStatus& serverCmd = m_data->m_serverStatus; |
| 409 | |
| 410 | do |
| 411 | { |
| 412 | bool hasStatus = m_data->m_commandProcessor->processCommand(command, m_data->m_serverStatus, &m_data->m_bulletStreamDataServerToClient[0], SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE); |
| 413 | |
| 414 | b3Clock clock; |
| 415 | double startTime = clock.getTimeInSeconds(); |
| 416 | double timeOutInSeconds = m_data->m_timeOutInSeconds; |
| 417 | |
| 418 | while ((!hasStatus) && (clock.getTimeInSeconds() - startTime < timeOutInSeconds)) |
| 419 | { |
| 420 | const SharedMemoryStatus* stat = processServerStatus(); |
| 421 | if (stat) |
| 422 | { |
| 423 | hasStatus = true; |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | m_data->m_hasStatus = hasStatus; |
| 428 | if (hasStatus) |
| 429 | { |
| 430 | if (m_data->m_verboseOutput) |
| 431 | { |
| 432 | b3Printf("Overlapping Objects Request OK\n"); |
| 433 | } |
| 434 | |
| 435 | int startOverlapIndex = serverCmd.m_sendOverlappingObjectsArgs.m_startingOverlappingObjectIndex; |
| 436 | int numOverlapCopied = serverCmd.m_sendOverlappingObjectsArgs.m_numOverlappingObjectsCopied; |
| 437 | m_data->m_cachedOverlappingObjects.resize(startOverlapIndex + numOverlapCopied); |
| 438 | b3OverlappingObject* objects = (b3OverlappingObject*)&m_data->m_bulletStreamDataServerToClient[0]; |
| 439 | |
| 440 | for (int i = 0; i < numOverlapCopied; i++) |
| 441 | { |
| 442 | m_data->m_cachedOverlappingObjects[startOverlapIndex + i] = objects[i]; |
| 443 | } |
| 444 | |
| 445 | if (serverCmd.m_sendOverlappingObjectsArgs.m_numRemainingOverlappingObjects > 0 && serverCmd.m_sendOverlappingObjectsArgs.m_numOverlappingObjectsCopied) |
| 446 | { |
| 447 | m_data->m_hasStatus = false; |
| 448 | command.m_type = CMD_REQUEST_AABB_OVERLAP; |
| 449 | command.m_requestOverlappingObjectsArgs.m_startingOverlappingObjectIndex = serverCmd.m_sendOverlappingObjectsArgs.m_startingOverlappingObjectIndex + serverCmd.m_sendOverlappingObjectsArgs.m_numOverlappingObjectsCopied; |
| 450 | } |
| 451 | } |
| 452 | } while (serverCmd.m_sendOverlappingObjectsArgs.m_numRemainingOverlappingObjects > 0 && serverCmd.m_sendOverlappingObjectsArgs.m_numOverlappingObjectsCopied); |
| 453 | |
| 454 | return m_data->m_hasStatus; |
| 455 | } |
| 456 | |
| 457 | bool PhysicsDirect::processContactPointData(const struct SharedMemoryCommand& orgCommand) |
| 458 | { |
nothing calls this directly
no test coverage detected