Camera BabylonJS-删除相机上的平滑动画
我正在做一个小游戏。Camera BabylonJS-删除相机上的平滑动画,camera,smooth,babylonjs,Camera,Smooth,Babylonjs,我正在做一个小游戏。 我正在使用此代码构建一个摄像头: this.cam = new BABYLON.FreeCamera("playerCamera", new BABYLON.Vector3(x, y, z), s); this.cam.checkCollisions = true; this.cam.applyGravity = false; this.cam.keysUp = [90]; // Z this.cam.keysDown = [83]; // S this.cam.k
我正在使用此代码构建一个摄像头:
this.cam = new BABYLON.FreeCamera("playerCamera", new BABYLON.Vector3(x, y, z), s);
this.cam.checkCollisions = true;
this.cam.applyGravity = false;
this.cam.keysUp = [90]; // Z
this.cam.keysDown = [83]; // S
this.cam.keysLeft = [81]; // Q
this.cam.keysRight = [68]; // D
this.cam.speed = v;
this.cam.ellipsoid = new BABYLON.Vector3(1, h, 1);
this.cam.angularSensibility = a;
它可以工作,我有一个摄像头,我可以四处走动……但我的问题是:在默认情况下,当移动和更改相机方向时,它们是平滑的动画。
让我解释一下:当我用箭头键移动时(大约向左移动20个像素),它将变为25个像素(20个像素+5个平滑像素)。
我不想要它:/n你知道如何禁用它吗?(移动和改变摄像机的方向)。这是由于自由摄像机中定义的惯性造成的 要消除这种“平滑”运动,只需禁用惯性:
this.cam.inertia = 0;
这是由于自由摄影机中定义的惯性造成的 要消除这种“平滑”运动,只需禁用惯性:
this.cam.inertia = 0;