summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuyuan Kelly Fu <fuchuyuan@google.com>2022-02-18 16:59:07 -0800
committerChuyuan Kelly Fu <fuchuyuan@google.com>2022-02-18 17:49:26 -0800
commit807cf3d387e03d5b47a7bf49f3d12780f6035210 (patch)
tree2791d96f51298adc57d00898b7abb878ba809c7a
parentbdba9fa2e0d6a34fc28aeeb6882575b5ddb9d4f5 (diff)
downloadbullet3-807cf3d387e03d5b47a7bf49f3d12780f6035210.tar.gz
format commit
-rw-r--r--examples/SharedMemory/PhysicsServerCommandProcessor.cpp38
-rw-r--r--examples/SharedMemory/SharedMemoryPublic.h9
2 files changed, 24 insertions, 23 deletions
diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
index 2506a767f..4f65462a5 100644
--- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
+++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
@@ -5512,24 +5512,26 @@ bool PhysicsServerCommandProcessor::processResetMeshDataCommand(const struct Sha
int numVertices = psb->m_nodes.size();
if (clientCmd.m_resetMeshDataArgs.m_numVertices == numVertices)
{
- if(clientCmd.m_updateFlags & B3_MESH_DATA_SIMULATION_MESH_VELOCITY){
- for (int i = 0; i < numVertices; ++i)
- {
- btSoftBody::Node& n = psb->m_nodes[i];
- n.m_v.setValue(vertexUpload[i*3+0], vertexUpload[i*3+1],vertexUpload[i*3+2]);
- n.m_vn.setValue(vertexUpload[i*3+0], vertexUpload[i*3+1],vertexUpload[i*3+2]);
- }
- }
- else{
- for (int i = 0; i < numVertices; ++i)
- {
- btSoftBody::Node& n = psb->m_nodes[i];
- n.m_x.setValue(vertexUpload[i*3+0], vertexUpload[i*3+1],vertexUpload[i*3+2]);
- n.m_q.setValue(vertexUpload[i*3+0], vertexUpload[i*3+1],vertexUpload[i*3+2]);
- }
- }
- serverStatusOut.m_type = CMD_RESET_MESH_DATA_COMPLETED;
- }
+ if (clientCmd.m_updateFlags & B3_MESH_DATA_SIMULATION_MESH_VELOCITY)
+ {
+ for (int i = 0; i < numVertices; ++i)
+ {
+ btSoftBody::Node& n = psb->m_nodes[i];
+ n.m_v.setValue(vertexUpload[i * 3 + 0], vertexUpload[i * 3 + 1], vertexUpload[i * 3 + 2]);
+ n.m_vn.setValue(vertexUpload[i * 3 + 0], vertexUpload[i * 3 + 1], vertexUpload[i * 3 + 2]);
+ }
+ }
+ else
+ {
+ for (int i = 0; i < numVertices; ++i)
+ {
+ btSoftBody::Node& n = psb->m_nodes[i];
+ n.m_x.setValue(vertexUpload[i * 3 + 0], vertexUpload[i * 3 + 1], vertexUpload[i * 3 + 2]);
+ n.m_q.setValue(vertexUpload[i * 3 + 0], vertexUpload[i * 3 + 1], vertexUpload[i * 3 + 2]);
+ }
+ }
+ serverStatusOut.m_type = CMD_RESET_MESH_DATA_COMPLETED;
+ }
}
#endif //SKIP_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD
}
diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h
index 90143b55e..6085f4a0f 100644
--- a/examples/SharedMemory/SharedMemoryPublic.h
+++ b/examples/SharedMemory/SharedMemoryPublic.h
@@ -461,13 +461,12 @@ struct b3MeshVertex
double x, y, z, w;
};
-
enum eMeshDataFlags
{
- B3_MESH_DATA_SIMULATION_MESH=1,
- B3_MESH_DATA_SIMULATION_INDICES=2,
- B3_MESH_DATA_GRAPHICS_INDICES=4,
- B3_MESH_DATA_SIMULATION_MESH_VELOCITY=8,
+ B3_MESH_DATA_SIMULATION_MESH = 1,
+ B3_MESH_DATA_SIMULATION_INDICES = 2,
+ B3_MESH_DATA_GRAPHICS_INDICES = 4,
+ B3_MESH_DATA_SIMULATION_MESH_VELOCITY = 8,
};
enum eMeshDataEnum