mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49:19 +02:00
Use glm::length2 instead of glm::length where possible
This commit is contained in:
@@ -630,8 +630,9 @@ std::pair<int, int> TSubModel::Load(cParser &parser, bool dynamic)
|
||||
if (idx > 0)
|
||||
{
|
||||
// jeśli pierwszy trójkąt będzie zdegenerowany, to zostanie usunięty i nie ma co sprawdzać
|
||||
if ((glm::length((vertex)->position - (vertex - 1)->position) > 1000.0) || (glm::length((vertex - 1)->position - (vertex - 2)->position) > 1000.0) ||
|
||||
(glm::length((vertex - 2)->position - (vertex)->position) > 1000.0))
|
||||
// length2 is better than length for comparing because it does not require sqrt function
|
||||
if ((glm::length2((vertex)->position - (vertex - 1)->position) > 1000.0 * 1000.0) || (glm::length2((vertex - 1)->position - (vertex - 2)->position) > 1000.0 * 1000.0) ||
|
||||
(glm::length2((vertex - 2)->position - (vertex)->position) > 1000.0 * 1000.0))
|
||||
{
|
||||
// jeżeli są dalej niż 2km od siebie //Ra 15-01:
|
||||
// obiekt wstawiany nie powinien być większy niż 300m (trójkąty terenu w E3D mogą mieć 1.5km)
|
||||
|
||||
Reference in New Issue
Block a user