fix pathedinterior bug

This commit is contained in:
RandomityGuy 2022-11-13 14:37:48 +05:30
parent 812af3925e
commit 2ae5f79890
2 changed files with 6 additions and 6 deletions

View file

@ -105,7 +105,8 @@ class PathedInterior extends InteriorObject {
if (this.baseScale.z == 0) if (this.baseScale.z == 0)
this.baseScale.z = 0.0001; 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]; 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)); var transform = this.getTransformAtTime(this.getInternalTime(thisTime));
this.setTransform(transform);
var position = transform.getPosition(); var position = transform.getPosition();
this.prevPosition = this.currentPosition; this.prevPosition = this.currentPosition;
@ -243,10 +245,8 @@ class PathedInterior extends InteriorObject {
} }
function updatePosition() { function updatePosition() {
var tform = this.collider.transform.clone(); this.setPosition(this.currentPosition.x, this.currentPosition.y, this.currentPosition.z);
tform.setPosition(this.currentPosition); this.collider.setTransform(this.getTransform());
this.setTransform(tform);
this.collider.setTransform(tform);
this.collider.velocity = this.velocity; this.collider.velocity = this.velocity;
if (this.soundChannel != null) { if (this.soundChannel != null) {

View file

@ -16,7 +16,7 @@ class Grid {
var surfaces:Array<CollisionSurface> = []; var surfaces:Array<CollisionSurface> = [];
public function new(bounds:Bounds) { 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); this.cellSize = new Vector(bounds.xSize / CELL_DIV.x, bounds.ySize / CELL_DIV.y, bounds.zSize / CELL_DIV.z);
} }