# Strange behavior of angularSpeed when change it between 0.001111 and 0.001112

**URL:** <https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987>\
**Category:** Bugs\
**Created:** [November 24, 2020, 12:43pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987 "2020-11-24T12:43:34Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ericetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ericetto/32/10966_2.png) [@Ericetto](https://forum.babylonjs.com/u/Ericetto)\
**Post date:** [November 24, 2020, 12:43pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/1 "2020-11-24T12:43:34Z")

</div>

I observe very strange behavior when changing angularSpeed between 0.001111 and 0.001112 values.  
When I set the value to 0.001112, the camera doesn’t rotate smoothly enough as I want:  
`camera.inputs.attached.keyboard.angularSpeed = 0.001112;`

When I set the value to 0.001111, the camera rotate too slow:  
`camera.inputs.attached.keyboard.angularSpeed = 0.001111;`

Therefore, I cannot set the sensitivity I need ☹  
Help me please

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 24, 2020, 1:43pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/2 "2020-11-24T13:43:35Z")

</div>

Would be great if you could reproduce the issue in the playground so that we could all have a look in order to help you the best we can.

It might be a precision issue in the generated matrices and I do hope it is not ☹

---

<div class="post-metadata">

**Author:** ![Ericetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ericetto/32/10966_2.png) [@Ericetto](https://forum.babylonjs.com/u/Ericetto)\
**Post date:** [November 25, 2020, 9:05am UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/3 "2020-11-25T09:05:46Z")

</div>

[https://www.babylonjs-playground.com/#14KRGG#263](https://www.babylonjs-playground.com/#14KRGG#263)

---

<div class="post-metadata">

**Author:** ![Ericetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ericetto/32/10966_2.png) [@Ericetto](https://forum.babylonjs.com/u/Ericetto)\
**Post date:** [November 27, 2020, 10:59am UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/4 "2020-11-27T10:59:34Z")

</div>

Is there any other way to change the sensitivity?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 27, 2020, 1:55pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/5 "2020-11-27T13:55:59Z")

</div>

Could you share a screen cap of your issue, it does work all great for me ☹ also your browser and version might help.

---

<div class="post-metadata">

**Author:** ![Ericetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ericetto/32/10966_2.png) [@Ericetto](https://forum.babylonjs.com/u/Ericetto)\
**Post date:** [November 27, 2020, 7:20pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/6 "2020-11-27T19:20:12Z")

</div>

I take turns hitting the right and left arrows on the video:

> **[Strange behavior of angularSpeed when change it between 0.001111 and 0.001112 \_... (video)](https://drive.google.com/file/d/1S7NAlZZsX6Eo8iFo5vxMs-h0UcnpG34d/view?usp=sharing)**
>
> Google Drive file.

  
Sorry, I didn’t specify that I mean the rotation of the camera with the arrows on the keyboard.

---

<div class="post-metadata">

**Author:** ![Ericetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ericetto/32/10966_2.png) [@Ericetto](https://forum.babylonjs.com/u/Ericetto)\
**Post date:** [November 30, 2020, 10:20am UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/7 "2020-11-30T10:20:00Z")

</div>

Moreover, when angularSpeed less than 0.001112 and you give initial rotation speed with the mouse, and continue to rotate with the arrows, then the speed seems to become normal.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 30, 2020, 1:55pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/8 "2020-11-30T13:55:37Z")

</div>

I am still unsure to see the issue on the video ☹ @RaananW or @Evgeni_Popov might have an idea ?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 30, 2020, 2:00pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/9 "2020-11-30T14:00:31Z")

</div>

What about trying in-between values like 0.0011115?

Note that using 0.001111 or 0.001112 on my local computer does not change anything, or at least I can’t see any difference.

Have you tried in other browsers?

---

<div class="post-metadata">

**Author:** ![Ericetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ericetto/32/10966_2.png) [@Ericetto](https://forum.babylonjs.com/u/Ericetto)\
**Post date:** [November 30, 2020, 3:40pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/10 "2020-11-30T15:40:53Z")

</div>

For values less than 0.001111111111111111 I have this issue. I think this value is periodic fraction 0.00(1), just the type precision is limited.

I tried on 5 computers in different browsers, the behavior is the same everywhere.

Could you record a screencast using = 0.001111 please?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 30, 2020, 4:02pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/11 "2020-11-30T16:02:10Z")

</div>

Sorry, I missed the part where you said one must use the keyboard!

So, I reproduced the problem and it comes from some epsilon used in the code.

More precisely, if `camera.inertia * camera.inertialAlphaOffset < epsilon`, `inertialAlphaOffset` is set to 0.

In your sample, `inertialAlphaOffset = angularSpeed = 0.001111` at start. `camera.inertia = 0.9`, so `inertialAlphaOffset * inertia = 0.0009999`. As `epsilon = 0.001`, `inertialAlphaOffset` is reset to 0…

So, you can fix your problem by raising a little `inertia` when using `angularSpeed = 0.001111`:

[https://playground.babylonjs.com/#3AHG5Y#1](https://playground.babylonjs.com/#3AHG5Y#1)

I wonder if we should let the user be able to change this epsilon value… @Deltakosh, @PolygonalSun, @sebavan?

---

<div class="post-metadata">

**Author:** ![Ericetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ericetto/32/10966_2.png) [@Ericetto](https://forum.babylonjs.com/u/Ericetto)\
**Post date:** [November 30, 2020, 10:59pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/12 "2020-11-30T22:59:40Z")

</div>

It was cool to be able to access epsilon because I actually need a value around `angularSpeed = 0.0007`, then `camera.inertia` must be at least `1.43` which is a bad value.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [December 1, 2020, 6:43am UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/13 "2020-12-01T06:43:43Z")

</div>

The Epsilon value should be configurable. It is not defined as const, so technically changing the imported value. Does it work when changing the value directly?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 1, 2020, 10:37am UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/14 "2020-12-01T10:37:17Z")

</div>

Setting `BABYLON.Epsilon = 0.0001;` does not work, the value is not retained.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [December 1, 2020, 1:35pm UTC](https://forum.babylonjs.com/t/strange-behavior-of-angularspeed-when-change-it-between-0-001111-and-0-001112/15987/15 "2020-12-01T13:35:06Z")

</div>

Yep, you are right. Seems like Webpack converts the Epsilon value to a getter function, which prevents the value from being changed (detailed here - [Allow module system that does not rely on getters in Webpack 4 · Issue #6979 · webpack/webpack · GitHub](https://github.com/webpack/webpack/issues/6979)). We will probably need to allow some sort of setter to an epsilon outside of this scope to allow the user to change the epsilon value
