You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
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.
This commit is contained in:
@@ -266,10 +266,10 @@ void NavigationMeshGenerator::_parse_geometry(const Transform3D &p_navmesh_trans
|
||||
if (err == OK) {
|
||||
PackedVector3Array faces;
|
||||
|
||||
for (int j = 0; j < md.faces.size(); ++j) {
|
||||
Geometry3D::MeshData::Face face = md.faces[j];
|
||||
for (uint32_t j = 0; j < md.faces.size(); ++j) {
|
||||
const Geometry3D::MeshData::Face &face = md.faces[j];
|
||||
|
||||
for (int k = 2; k < face.indices.size(); ++k) {
|
||||
for (uint32_t k = 2; k < face.indices.size(); ++k) {
|
||||
faces.push_back(md.vertices[face.indices[0]]);
|
||||
faces.push_back(md.vertices[face.indices[k - 1]]);
|
||||
faces.push_back(md.vertices[face.indices[k]]);
|
||||
@@ -392,10 +392,10 @@ void NavigationMeshGenerator::_parse_geometry(const Transform3D &p_navmesh_trans
|
||||
if (err == OK) {
|
||||
PackedVector3Array faces;
|
||||
|
||||
for (int j = 0; j < md.faces.size(); ++j) {
|
||||
Geometry3D::MeshData::Face face = md.faces[j];
|
||||
for (uint32_t j = 0; j < md.faces.size(); ++j) {
|
||||
const Geometry3D::MeshData::Face &face = md.faces[j];
|
||||
|
||||
for (int k = 2; k < face.indices.size(); ++k) {
|
||||
for (uint32_t k = 2; k < face.indices.size(); ++k) {
|
||||
faces.push_back(md.vertices[face.indices[0]]);
|
||||
faces.push_back(md.vertices[face.indices[k - 1]]);
|
||||
faces.push_back(md.vertices[face.indices[k]]);
|
||||
|
||||
Reference in New Issue
Block a user