From 92fd215fa0c7f8b926bae25533039d1e764fbd04 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Thu, 16 Feb 2023 00:47:23 +0530 Subject: [PATCH] make cgl 10 load atleast --- src/Mission.hx | 2 ++ src/collision/CollisionEntity.hx | 40 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/Mission.hx b/src/Mission.hx index 203bd12b..d06613ad 100644 --- a/src/Mission.hx +++ b/src/Mission.hx @@ -139,6 +139,8 @@ class Mission { #if (js || android) path = StringTools.replace(path, "data/", ""); #end + if (!StringTools.endsWith(path, ".dif")) + path += ".dif"; if (ResourceLoader.fileSystem.exists(path)) return path; return ""; diff --git a/src/collision/CollisionEntity.hx b/src/collision/CollisionEntity.hx index 766c36c0..ff3daa2c 100644 --- a/src/collision/CollisionEntity.hx +++ b/src/collision/CollisionEntity.hx @@ -73,26 +73,26 @@ class CollisionEntity implements IOctreeObject implements IBVHObject { if (this.transform.equal(transform)) return; // Speedup - // if (Util.mat3x3equal(this.transform, transform)) { - // var oldPos = this.transform.getPosition(); - // var newPos = transform.getPosition(); - // this.transform.setPosition(newPos); - // this.invTransform.setPosition(newPos.multiply(-1)); - // if (this.boundingBox == null) - // generateBoundingBox(); - // else { - // this.boundingBox.xMin += newPos.x - oldPos.x; - // this.boundingBox.xMax += newPos.x - oldPos.x; - // this.boundingBox.yMin += newPos.y - oldPos.y; - // this.boundingBox.yMax += newPos.y - oldPos.y; - // this.boundingBox.zMin += newPos.z - oldPos.z; - // this.boundingBox.zMax += newPos.z - oldPos.z; - // } - // } else { - this.transform.load(transform); - this.invTransform = transform.getInverse(); - generateBoundingBox(); - // } + if (Util.mat3x3equal(this.transform, transform)) { + var oldPos = this.transform.getPosition(); + var newPos = transform.getPosition(); + this.transform.setPosition(newPos); + this.invTransform.setPosition(newPos.multiply(-1)); + if (this.boundingBox == null) + generateBoundingBox(); + else { + this.boundingBox.xMin += newPos.x - oldPos.x; + this.boundingBox.xMax += newPos.x - oldPos.x; + this.boundingBox.yMin += newPos.y - oldPos.y; + this.boundingBox.yMax += newPos.y - oldPos.y; + this.boundingBox.zMin += newPos.z - oldPos.z; + this.boundingBox.zMax += newPos.z - oldPos.z; + } + } else { + this.transform.load(transform); + this.invTransform = transform.getInverse(); + generateBoundingBox(); + } _transformKey++; }