fix pathedinterior bug

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

View file

@ -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) {

View file

@ -16,7 +16,7 @@ class Grid {
var surfaces:Array<CollisionSurface> = [];
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);
}