add performCollisionDetection (stepSimulation also calls this, but does more, including solving constraints and integration)

This commit is contained in:
erwin coumans
2021-03-26 10:31:13 -07:00
parent 0196edd4d2
commit d1c4c41b9a
8 changed files with 95 additions and 1 deletions

View File

@@ -9483,6 +9483,24 @@ bool PhysicsServerCommandProcessor::processRequestCollisionInfoCommand(const str
return hasStatus;
}
bool PhysicsServerCommandProcessor::performCollisionDetectionCommand(const struct SharedMemoryCommand& clientCmd, struct SharedMemoryStatus& serverStatusOut, char* bufferServerToClient, int bufferSizeInBytes)
{
bool hasStatus = true;
BT_PROFILE("CMD_PERFORM_COLLISION_DETECTION");
if (m_data->m_verboseOutput)
{
b3Printf("Perform Collision Detection command");
b3Printf("CMD_PERFORM_COLLISION_DETECTION clientCmd = %d\n", clientCmd.m_sequenceNumber);
}
m_data->m_dynamicsWorld->performDiscreteCollisionDetection();
SharedMemoryStatus& serverCmd = serverStatusOut;
serverCmd.m_type = CMD_PERFORM_COLLISION_DETECTION_COMPLETED;
return true;
}
bool PhysicsServerCommandProcessor::processForwardDynamicsCommand(const struct SharedMemoryCommand& clientCmd, struct SharedMemoryStatus& serverStatusOut, char* bufferServerToClient, int bufferSizeInBytes)
{
bool hasStatus = true;
@@ -14131,6 +14149,11 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
hasStatus = processForwardDynamicsCommand(clientCmd, serverStatusOut, bufferServerToClient, bufferSizeInBytes);
break;
}
case CMD_PERFORM_COLLISION_DETECTION:
{
hasStatus = performCollisionDetectionCommand(clientCmd, serverStatusOut, bufferServerToClient, bufferSizeInBytes);
break;
}
case CMD_REQUEST_INTERNAL_DATA:
{