use fast transforms for colliders

This commit is contained in:
RandomityGuy 2023-05-19 19:10:55 +05:30
parent fcbb7e3e28
commit 1a1ddc8fe3
2 changed files with 3 additions and 1 deletions

View file

@ -104,6 +104,7 @@ class PathedInterior extends InteriorObject {
this.setRotationQuat(this.baseOrientation.clone());
this.collider.setTransform(this.getTransform());
this.collider.fastTransform = true;
this.path = cast this.simGroup.elements.filter((element) -> element._type == MissionElementType.Path)[0];

View file

@ -37,6 +37,7 @@ class CollisionEntity implements IOctreeObject implements IBVHObject {
public var go:GameObject;
public var userData:Int;
public var fastTransform:Bool = false;
public var difEdgeMap:Map<Int, dif.Edge>;
@ -73,7 +74,7 @@ class CollisionEntity implements IOctreeObject implements IBVHObject {
if (this.transform.equal(transform))
return;
// Speedup
if (Util.mat3x3equal(this.transform, transform)) {
if (this.fastTransform && Util.mat3x3equal(this.transform, transform)) {
var oldPos = this.transform.getPosition();
var newPos = transform.getPosition();
this.transform.setPosition(newPos);