Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Camera BabylonJS-删除相机上的平滑动画_Camera_Smooth_Babylonjs - Fatal编程技术网

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;