mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-28 09:53:06 +02:00
update worldview pos, extend view range
This commit is contained in:
parent
c13bf4895d
commit
39abf8a19e
1 changed files with 2 additions and 1 deletions
|
@ -17,7 +17,7 @@ export class Camera extends EventEmitter {
|
||||||
super();
|
super();
|
||||||
this.bot = bot;
|
this.bot = bot;
|
||||||
this.fp = fp;
|
this.fp = fp;
|
||||||
this.viewDistance = 4;
|
this.viewDistance = 12;
|
||||||
this.width = 800;
|
this.width = 800;
|
||||||
this.height = 512;
|
this.height = 512;
|
||||||
this.canvas = createCanvas(this.width, this.height);
|
this.canvas = createCanvas(this.width, this.height);
|
||||||
|
@ -43,6 +43,7 @@ export class Camera extends EventEmitter {
|
||||||
async capture() {
|
async capture() {
|
||||||
const center = new Vec3(this.bot.entity.position.x, this.bot.entity.position.y+this.bot.entity.height, this.bot.entity.position.z);
|
const center = new Vec3(this.bot.entity.position.x, this.bot.entity.position.y+this.bot.entity.height, this.bot.entity.position.z);
|
||||||
this.viewer.camera.position.set(center.x, center.y, center.z);
|
this.viewer.camera.position.set(center.x, center.y, center.z);
|
||||||
|
await this.worldView.updatePosition(center);
|
||||||
this.viewer.setFirstPersonCamera(this.bot.entity.position, this.bot.entity.yaw, this.bot.entity.pitch);
|
this.viewer.setFirstPersonCamera(this.bot.entity.position, this.bot.entity.yaw, this.bot.entity.pitch);
|
||||||
this.viewer.update();
|
this.viewer.update();
|
||||||
this.renderer.render(this.viewer.scene, this.viewer.camera);
|
this.renderer.render(this.viewer.scene, this.viewer.camera);
|
||||||
|
|
Loading…
Add table
Reference in a new issue