diff --git a/src/PathedInterior.hx b/src/PathedInterior.hx index d14ffde4..909b263f 100644 --- a/src/PathedInterior.hx +++ b/src/PathedInterior.hx @@ -105,7 +105,8 @@ class PathedInterior extends InteriorObject { if (this.baseScale.z == 0) this.baseScale.z = 0.0001; - this.setRotationQuat(this.baseOrientation); + this.setRotationQuat(this.baseOrientation.clone()); + this.collider.setTransform(this.getTransform()); this.path = cast this.simGroup.elements.filter((element) -> element._type == MissionElementType.Path)[0]; @@ -161,6 +162,7 @@ class PathedInterior extends InteriorObject { } var transform = this.getTransformAtTime(this.getInternalTime(thisTime)); + this.setTransform(transform); var position = transform.getPosition(); this.prevPosition = this.currentPosition; @@ -243,10 +245,8 @@ class PathedInterior extends InteriorObject { } function updatePosition() { - var tform = this.collider.transform.clone(); - tform.setPosition(this.currentPosition); - this.setTransform(tform); - this.collider.setTransform(tform); + this.setPosition(this.currentPosition.x, this.currentPosition.y, this.currentPosition.z); + this.collider.setTransform(this.getTransform()); this.collider.velocity = this.velocity; if (this.soundChannel != null) { diff --git a/src/collision/Grid.hx b/src/collision/Grid.hx index 2aad5d4a..1f11987f 100644 --- a/src/collision/Grid.hx +++ b/src/collision/Grid.hx @@ -16,7 +16,7 @@ class Grid { var surfaces:Array = []; public function new(bounds:Bounds) { - this.bounds = bounds; + this.bounds = bounds.clone(); this.cellSize = new Vector(bounds.xSize / CELL_DIV.x, bounds.ySize / CELL_DIV.y, bounds.zSize / CELL_DIV.z); }