4 Commits

Author SHA1 Message Date
David Briscoe
29954aa60e vec: Add nan checking functions
Add:
* vec2.has_nan + test
* vec3.has_nan + test
* quat.has_nan
* mat4.has_nan
* utils.is_nan + test
2022-03-26 23:33:13 -07:00
David Briscoe
4dc773865e Reference private.round instead of util.round
Fix "Error: src/lib/cpml/modules/_private_utils.lua:8: attempt to index
    global 'utils' (a nil value)"

Looks like when round was moved to _private_utils, this didn't get
replaced. There is no utils defined and utils.round just points to
private.round.

Add a test. This never triggered test failures because test don't pass
precision.

Test
A love2d program with main.lua:
    local Vec2 = require "cpml.modules.vec2"
    local v = Vec2(1.234, 3.5326)
    print(v:round(0.1))
2021-11-24 09:55:57 -08:00
mcc
0d8daf0536 Fix typo breaking round() calls 2020-05-21 23:39:14 -04:00
mcc
8e65db07ce :round(precision) methods for vec2, vec3, bound2, bound3
Uses utils.lua, which requires moving utils.round to a new _private_utils.lua
2019-11-30 00:03:55 -05:00