@@ -27882,10 +27882,10 @@ class Camera extends AuxiliaryHolder {
27882
27882
position = new PositionMatrix(() => this.updateInformer.informUpdate(MatrixUniform.CAM_POS));
27883
27883
tilt = new TiltMatrix(() => this.updateInformer.informUpdate(MatrixUniform.CAM_TILT));
27884
27884
turn = new TurnMatrix(() => this.updateInformer.informUpdate(MatrixUniform.CAM_TURN));
27885
- _curvature = 0.05;
27886
- _distance = 0.5;
27887
27885
_bgColor = [0, 0, 0];
27888
- _blur = 1;
27886
+ curvature;
27887
+ distance;
27888
+ blur;
27889
27889
_viewportWidth = 0;
27890
27890
_viewportHeight = 0;
27891
27891
updateInformer;
@@ -27896,9 +27896,17 @@ class Camera extends AuxiliaryHolder {
27896
27896
super();
27897
27897
this.engine = engine;
27898
27898
this.updateInformer = new CameraUpdate(this.getCameraMatrix.bind(this), engine, motor);
27899
- this.updateInformerFloat = new CameraFloatUpdate(this.getCameraFloat.bind(this), engine, motor);
27900
27899
this.updateInformerVector = new CameraVectorUpdate(this.getCameraVector.bind(this), engine, motor);
27901
27900
this.addAuxiliary(this.position);
27901
+ this.curvature = new NumVal(0.05, () => this.updateInformerFloat.informUpdate(FloatUniform.CURVATURE));
27902
+ this.distance = new NumVal(0.5, () => this.updateInformerFloat.informUpdate(FloatUniform.CAM_DISTANCE));
27903
+ this.blur = new NumVal(1, () => this.updateInformerFloat.informUpdate(FloatUniform.BG_BLUR));
27904
+ const cameraVal = {
27905
+ [FloatUniform.BG_BLUR]: this.blur,
27906
+ [FloatUniform.CAM_DISTANCE]: this.distance,
27907
+ [FloatUniform.CURVATURE]: this.curvature
27908
+ };
27909
+ this.updateInformerFloat = new CameraFloatUpdate((uniform) => cameraVal[uniform].valueOf(), engine, motor);
27902
27910
}
27903
27911
activate() {
27904
27912
super.activate();
@@ -27927,18 +27935,6 @@ class Camera extends AuxiliaryHolder {
27927
27935
this.projection.configure(this._viewportWidth, this._viewportHeight);
27928
27936
}
27929
27937
}
27930
- set curvature(value) {
27931
- this._curvature = value;
27932
- this.updateInformerFloat.informUpdate(FloatUniform.CURVATURE);
27933
- }
27934
- set distance(value) {
27935
- this._distance = value;
27936
- this.updateInformerFloat.informUpdate(FloatUniform.CAM_DISTANCE);
27937
- }
27938
- set blur(value) {
27939
- this._blur = value;
27940
- this.updateInformerFloat.informUpdate(FloatUniform.BG_BLUR);
27941
- }
27942
27938
set bgColor(rgb) {
27943
27939
const red = rgb >> 16 & 255;
27944
27940
const green = rgb >> 8 & 255;
@@ -27955,16 +27951,6 @@ class Camera extends AuxiliaryHolder {
27955
27951
}
27956
27952
return this.cameraMatrices[uniform].getMatrix();
27957
27953
}
27958
- getCameraFloat(uniform) {
27959
- switch (uniform) {
27960
- case FloatUniform.CURVATURE:
27961
- return this._curvature;
27962
- case FloatUniform.CAM_DISTANCE:
27963
- return this._distance;
27964
- case FloatUniform.BG_BLUR:
27965
- return this._blur;
27966
- }
27967
- }
27968
27954
getCameraVector(uniform) {
27969
27955
return this.cameraVectors[uniform];
27970
27956
}
@@ -29227,4 +29213,4 @@ export {
29227
29213
hello
29228
29214
};
29229
29215
29230
- //# debugId=4741CFF52A840FEC64756e2164756e21
29216
+ //# debugId=6B8D66F0E9CB986764756e2164756e21
0 commit comments