|
|
|
@ -30,7 +30,7 @@ export class TextureStore
|
|
|
|
|
this.repeatY.get();
|
|
|
|
|
this.rotation.get();
|
|
|
|
|
this.UpdateEvent();
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
dispose()
|
|
|
|
|
{
|
|
|
|
@ -55,6 +55,8 @@ export class TextureStore
|
|
|
|
|
this.textureId = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private updateing = false;
|
|
|
|
|
UpdateStore(textureId: ObjectId | TextureTableRecord)
|
|
|
|
|
{
|
|
|
|
|
if (!textureId) return;
|
|
|
|
@ -71,23 +73,28 @@ export class TextureStore
|
|
|
|
|
texture = textureId;
|
|
|
|
|
this.textureId = textureId.Id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.updateing = true;
|
|
|
|
|
|
|
|
|
|
this.repeatX.set(texture.repeatX);
|
|
|
|
|
this.repeatY.set(texture.repeatY);
|
|
|
|
|
this.warpS.set(texture.wrapS);
|
|
|
|
|
this.wrapT.set(texture.wrapT);
|
|
|
|
|
this.warpS.set(texture.WrapS);
|
|
|
|
|
this.wrapT.set(texture.WrapT);
|
|
|
|
|
let deg = Math.radToDeg(texture.rotation);
|
|
|
|
|
this.rotation.set(parseFloat(FixedNotZero(deg, 1)));
|
|
|
|
|
this.textureImg = texture.imageUrl;
|
|
|
|
|
|
|
|
|
|
this.updateing = false;
|
|
|
|
|
}
|
|
|
|
|
UpdateEvent()
|
|
|
|
|
{
|
|
|
|
|
if (this.textureId)
|
|
|
|
|
if (this.textureId && !this.updateing)
|
|
|
|
|
{
|
|
|
|
|
let texture = this.textureId.Object as TextureTableRecord;
|
|
|
|
|
texture.wrapS = this.warpS.get();
|
|
|
|
|
texture.wrapT = this.wrapT.get();
|
|
|
|
|
texture.WrapS = this.warpS.get();
|
|
|
|
|
texture.WrapT = this.wrapT.get();
|
|
|
|
|
texture.rotation = Math.degToRad(this.rotation.get());
|
|
|
|
|
if (texture.wrapS === ClampToEdgeWrapping)
|
|
|
|
|
if (texture.WrapS === ClampToEdgeWrapping)
|
|
|
|
|
{
|
|
|
|
|
texture.repeatX = 1;
|
|
|
|
|
this.repeatX.set(1);
|
|
|
|
@ -95,7 +102,7 @@ export class TextureStore
|
|
|
|
|
else
|
|
|
|
|
texture.repeatX = this.repeatX.get();
|
|
|
|
|
|
|
|
|
|
if (texture.wrapT === ClampToEdgeWrapping)
|
|
|
|
|
if (texture.WrapT === ClampToEdgeWrapping)
|
|
|
|
|
{
|
|
|
|
|
texture.repeatY = 1;
|
|
|
|
|
this.repeatY.set(1);
|
|
|
|
|