官术网_书友最值得收藏!

Epsilon

Comparing floating point numbers is difficult. Instead of comparing two floating point numbers directly, you need to compare them using an epsilon. An epsilon is an arbitrarily small positive number that is the minimum difference two numbers need to have to be considered different numbers. Declare an epsilon constant in vec3.h:

#define VEC3_EPSILON 0.000001f

Important note:

You can learn more about floating point comparison at https://bitbashing.io/comparing-floats.html

With the vec3 structure created and the vec3 epsilon defined, you are ready to start implementing some common vector operations. In the next section, you're going to start by learning and implementing several component-wise operations.

主站蜘蛛池模板: 扬中市| 镶黄旗| 石渠县| 泸州市| 杭锦旗| 衢州市| 巴东县| 辉县市| 崇明县| 张家口市| 论坛| 饶河县| 北川| 巴塘县| 樟树市| 东山县| 郁南县| 肥城市| 三明市| 溧水县| 安丘市| 泗洪县| 红原县| 论坛| 蓝山县| 翼城县| 鲜城| 蒙山县| 长兴县| 贡觉县| 乐陵市| 资阳市| 闽侯县| 三亚市| 启东市| 香格里拉县| 南阳市| 新竹市| 枣庄市| 绥阳县| 岑溪市|