use fast transforms for colliders

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

View file

@ -107,6 +107,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

@ -36,6 +36,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>;
@ -72,7 +73,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);