summaryrefslogtreecommitdiffstats
path: root/scene/3d/soft_body_3d.cpp
diff options
context:
space:
mode:
authorMikael Hermansson <mikael@hermansson.io>2024-02-16 15:40:55 +0100
committerMikael Hermansson <mikael@hermansson.io>2024-02-16 15:49:56 +0100
commit701ecd3a0de985e12732ef6cc41eb7a148c57f4a (patch)
treeafa63526f705530fdf3499310be4ead453db8280 /scene/3d/soft_body_3d.cpp
parenta9bb8509f2faac81bdb995c6c89a5347372f3498 (diff)
downloadredot-engine-701ecd3a0de985e12732ef6cc41eb7a148c57f4a.tar.gz
Fix `SoftBody3D` for double-precision builds
Diffstat (limited to 'scene/3d/soft_body_3d.cpp')
-rw-r--r--scene/3d/soft_body_3d.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp
index fb6a45846c..540e70866a 100644
--- a/scene/3d/soft_body_3d.cpp
+++ b/scene/3d/soft_body_3d.cpp
@@ -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) {