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

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.

主站蜘蛛池模板: 光泽县| 宁河县| 古浪县| 从江县| 新民市| 浠水县| 城口县| 射洪县| 成都市| 南岸区| 永兴县| 罗定市| 凌云县| 平果县| 肥西县| 翁牛特旗| 洞口县| 桂平市| 湛江市| 鹿邑县| 德清县| 仙游县| 东港市| 乌拉特前旗| 长宁区| 长治市| 泽库县| 城口县| 湖州市| 大化| 仁怀市| 南平市| 洛南县| 泰宁县| 商洛市| 伊宁市| 绥德县| 运城市| 安远县| 获嘉县| 海口市|