Skip to content

Commit ffc56bd

Browse files
committed
WIP
1 parent 75b4430 commit ffc56bd

File tree

5 files changed

+39
-67
lines changed

5 files changed

+39
-67
lines changed

build/index.js

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27882,10 +27882,10 @@ class Camera extends AuxiliaryHolder {
2788227882
position = new PositionMatrix(() => this.updateInformer.informUpdate(MatrixUniform.CAM_POS));
2788327883
tilt = new TiltMatrix(() => this.updateInformer.informUpdate(MatrixUniform.CAM_TILT));
2788427884
turn = new TurnMatrix(() => this.updateInformer.informUpdate(MatrixUniform.CAM_TURN));
27885-
_curvature = 0.05;
27886-
_distance = 0.5;
2788727885
_bgColor = [0, 0, 0];
27888-
_blur = 1;
27886+
curvature;
27887+
distance;
27888+
blur;
2788927889
_viewportWidth = 0;
2789027890
_viewportHeight = 0;
2789127891
updateInformer;
@@ -27896,9 +27896,17 @@ class Camera extends AuxiliaryHolder {
2789627896
super();
2789727897
this.engine = engine;
2789827898
this.updateInformer = new CameraUpdate(this.getCameraMatrix.bind(this), engine, motor);
27899-
this.updateInformerFloat = new CameraFloatUpdate(this.getCameraFloat.bind(this), engine, motor);
2790027899
this.updateInformerVector = new CameraVectorUpdate(this.getCameraVector.bind(this), engine, motor);
2790127900
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);
2790227910
}
2790327911
activate() {
2790427912
super.activate();
@@ -27927,18 +27935,6 @@ class Camera extends AuxiliaryHolder {
2792727935
this.projection.configure(this._viewportWidth, this._viewportHeight);
2792827936
}
2792927937
}
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-
}
2794227938
set bgColor(rgb) {
2794327939
const red = rgb >> 16 & 255;
2794427940
const green = rgb >> 8 & 255;
@@ -27955,16 +27951,6 @@ class Camera extends AuxiliaryHolder {
2795527951
}
2795627952
return this.cameraMatrices[uniform].getMatrix();
2795727953
}
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-
}
2796827954
getCameraVector(uniform) {
2796927955
return this.cameraVectors[uniform];
2797027956
}
@@ -29227,4 +29213,4 @@ export {
2922729213
hello
2922829214
};
2922929215

29230-
//# debugId=4741CFF52A840FEC64756e2164756e21
29216+
//# debugId=6B8D66F0E9CB986764756e2164756e21

0 commit comments

Comments
 (0)