mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-12 12:50:08 +00:00
reset deformable velocity
This commit is contained in:
parent
07de08a38e
commit
236d39d2ec
@ -5512,13 +5512,24 @@ 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_x.setValue(vertexUpload[i*3+0], vertexUpload[i*3+1],vertexUpload[i*3+2]);
|
||||
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]);
|
||||
}
|
||||
serverStatusOut.m_type = CMD_RESET_MESH_DATA_COMPLETED;
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ 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_VELOCITY=8,
|
||||
};
|
||||
|
||||
enum eMeshDataEnum
|
||||
|
Loading…
Reference in New Issue
Block a user