WebGL_0014:改变相机的刷新颜色

1,

CameraColorShift.prototype.OnColorShift = function(a) {
    switch (a) {
    case 0:
        targetColor = this.colorTable_1;
        break;
    case 1:
        targetColor = this.colorTable_2;
        break;
    case 2:
        targetColor = this.colorTable_3;
        break;
    case 3:
        targetColor = this.colorTable_4;
        break;
    case 4:
        targetColor = this.colorTable_5;
        break;
    default:
        targetColor = this.colorTable_1
    }
    this.lerpTimer = 0
};
CameraColorShift.prototype.LerpMatColorTo = function(a, b) {
    return a.r += (b.r - a.r) * this.colorLerpSpeed, a.g += (b.g - a.g) * this.colorLerpSpeed, a.b += (b.b - a.b) * this.colorLerpSpeed, a
};
CameraColorShift.prototype.update = function(a) {
    if (this.lerpTimer < this.lerpTimeTotal) {
        var b;
        b = this.entity.camera.clearColor;
        b = new pc.Color(b.r, b.g, b.b);
        b = this.LerpMatColorTo(b, targetColor);
        this.entity.camera.clearColor = new pc.Color(b.r, b.g, b.b);
        this.lerpTimer += a
    }
};
CameraColorShift.prototype.swap = function(a) {};

 

WebGL_0014:改变相机的刷新颜色

 

WebGL_0014:改变相机的刷新颜色

上一篇:php保留2位小数方法


下一篇:vue.js监听浏览器窗口宽度变化