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

Method processCommand

examples/SharedMemory/PhysicsClientTCP.cpp:155–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155bool TcpNetworkedPhysicsProcessor::processCommand(const struct SharedMemoryCommand& clientCmd, struct SharedMemoryStatus& serverStatusOut, char* bufferServerToClient, int bufferSizeInBytes)
156{
157 if (gVerboseNetworkMessagesClient2)
158 {
159 printf("PhysicsClientTCP::processCommand\n");
160 }
161
162 {
163 int sz = 0;
164 unsigned char* data = 0;
165 m_data->m_tempBuffer.clear();
166
167 if (clientCmd.m_type == CMD_STEP_FORWARD_SIMULATION)
168 {
169 sz = sizeof(int);
170 data = (unsigned char*)&clientCmd.m_type;
171 }
172 else
173 {
174 if (clientCmd.m_type == CMD_REQUEST_VR_EVENTS_DATA)
175 {
176 sz = 3 * sizeof(int) + sizeof(smUint64_t) + 16;
177 data = (unsigned char*)&clientCmd;
178 }
179 else
180 {
181 sz = sizeof(SharedMemoryCommand);
182 data = (unsigned char*)&clientCmd;
183 }
184 }
185
186 m_data->m_tcpSocket.Send((const uint8*)data, sz);
187 }
188
189 return false;
190}
191
192bool TcpNetworkedPhysicsProcessor::receiveStatus(struct SharedMemoryStatus& serverStatusOut, char* bufferServerToClient, int bufferSizeInBytes)
193{

Callers 12

connectMethod · 0.45
processDebugLinesMethod · 0.45
processCameraMethod · 0.45
processMeshDataMethod · 0.45
postProcessStatusMethod · 0.45
processCustomCommandMethod · 0.45
submitClientCommandMethod · 0.45
processClientCommandsMethod · 0.45

Calls 2

clearMethod · 0.45
SendMethod · 0.45

Tested by

no test coverage detected