diff options
author | Juan Linietsky <reduzio@gmail.com> | 2022-09-23 12:37:40 +0200 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2022-10-13 19:07:53 +0200 |
commit | 71d2e38cb528c95b0b154c5c9b22b0be4f04884a (patch) | |
tree | 5cdf41318b4bd337921edd10e6453097830afad6 /editor/plugins | |
parent | 99bc4905cbdeec4f91673aaf501703e28180c9d9 (diff) |
Optimize Convex Collision
Implements the Gauss Mapping optimization to SAT convex collision test.
* Described [here](https://ubm-twvideo01.s3.amazonaws.com/o1/vault/gdc2013/slides/822403Gregorius_Dirk_TheSeparatingAxisTest.pdf) by Dirk Gregorius.
* Requires adding of face information to edges in MeshData
* Took the chance to convert MeshData to LocalVector for performance.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/node_3d_editor_gizmos.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp index 7194cd9d27..26af5e3f2d 100644 --- a/editor/plugins/node_3d_editor_gizmos.cpp +++ b/editor/plugins/node_3d_editor_gizmos.cpp @@ -4751,9 +4751,9 @@ void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { if (err == OK) { Vector<Vector3> points2; points2.resize(md.edges.size() * 2); - for (int i = 0; i < md.edges.size(); i++) { - points2.write[i * 2 + 0] = md.vertices[md.edges[i].a]; - points2.write[i * 2 + 1] = md.vertices[md.edges[i].b]; + for (uint32_t i = 0; i < md.edges.size(); i++) { + points2.write[i * 2 + 0] = md.vertices[md.edges[i].vertex_a]; + points2.write[i * 2 + 1] = md.vertices[md.edges[i].vertex_b]; } p_gizmo->add_lines(points2, material); |