We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 459e753 commit 44bcb3dCopy full SHA for 44bcb3d
1 file changed
class.ts
@@ -164,9 +164,9 @@ namespace Polymesh {
164
165
}
166
167
- rotateToView(width: number, height: number, cam?: view) {
+ rotateToView(cam?: view) {
168
if (cam) this.curcam = cam;
169
- const centerX = width >>> 1, centerY = height >>> 1;
+ const centerX = this.curcam.viewport.width >>> 1, centerY = this.curcam.viewport.height >>> 1;
170
171
let tmp = 0
172
const cosX = fcos(this.curcam.rot.x), sinX = fsin(this.curcam.rot.x);
@@ -371,6 +371,7 @@ namespace Polymesh {
371
};
372
373
__onLoop() {
374
+ this.rotateToView();
375
this.updImgLodCacheSlot();
376
this.updImgLodCache();
377
0 commit comments