Merge pull request #88402 from mihe/double-soft-body

Fix `SoftBody3D` for double-precision builds
This commit is contained in:
Rémi Verschelde 2024-02-17 00:27:11 +01:00
commit d094b86d20
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 4 additions and 1 deletions

View File

@ -82,7 +82,10 @@ void SoftBodyRenderingServerHandler::commit_changes() {
}
void SoftBodyRenderingServerHandler::set_vertex(int p_vertex_id, const Vector3 &p_vertex) {
memcpy(&write_buffer[p_vertex_id * stride + offset_vertices], &p_vertex, sizeof(Vector3));
float *vertex_buffer = reinterpret_cast<float *>(write_buffer + p_vertex_id * stride + offset_vertices);
*vertex_buffer++ = (float)p_vertex.x;
*vertex_buffer++ = (float)p_vertex.y;
*vertex_buffer++ = (float)p_vertex.z;
}
void SoftBodyRenderingServerHandler::set_normal(int p_vertex_id, const Vector3 &p_normal) {