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

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.

主站蜘蛛池模板: 江门市| 甘孜县| 濮阳市| 仙桃市| 河东区| 招远市| 阿拉尔市| 徐闻县| 科技| 龙岩市| 思南县| 北川| 虎林市| 恩施市| 三门峡市| 大关县| 明水县| 汕尾市| 灵台县| 威宁| 扎囊县| 富平县| 嘉祥县| 南部县| 合水县| 武威市| 曲周县| 凉城县| 湾仔区| 穆棱市| 营口市| 新疆| 江口县| 泽州县| 岑溪市| 怀来县| 都兰县| 张家口市| 江口县| 鹿泉市| 东方市|