fix: reset rotation

This commit is contained in:
cha0s 2024-08-05 22:47:55 -05:00
parent 65f1fe6270
commit 591c1201f4

View File

@ -163,11 +163,16 @@ export default class Entity {
});
}
}
if (!this.attached) {
const {diffuse, normals} = this;
diffuse.rotation = 0;
normals.rotation = 0;
}
if (Direction) {
const {diffuse, normals} = this;
if ('direction' in Direction) {
if (!this.attached || 'direction' in Direction) {
if (this.entity.Sprite.rotates) {
const rotation = Direction.direction + this.entity.Sprite.rotation;
const rotation = this.entity.Direction.direction + this.entity.Sprite.rotation;
diffuse.rotation = rotation;
normals.rotation = rotation;
}