Fix flashlights

This commit is contained in:
schmelczerandras 2020-10-02 11:23:10 +02:00
parent d2ae2cc489
commit 374796f398
3 changed files with 22 additions and 13 deletions

View file

@ -19,7 +19,7 @@ export class Flashlight extends LightDrawable {
vec2.fromValues(0, 0),
vec3.fromValues(0, 0, 0),
0,
vec2.fromValues(0, 0)
vec2.fromValues(1, 0)
),
};
@ -35,7 +35,7 @@ export class Flashlight extends LightDrawable {
protected getObjectToSerialize(transform2d: mat2d, transform1d: number): any {
return {
...super.getObjectToSerialize(transform2d, transform1d),
direction: this.direction,
direction: vec2.normalize(vec2.create(), this.direction),
};
}
}