73 Commits

Author SHA1 Message Date
Matthew Blanchard
aba6b9b1c1 Corrected an issue with vec3 2015-12-19 23:56:56 -05:00
Matthew Blanchard
2ce72e3d0c Removed redundant vec3-turbo. 2015-12-19 23:49:51 -05:00
Matthew Blanchard
1531bf4abb Refactored the vec3 class. 2015-12-19 23:49:03 -05:00
Matthew Blanchard
3893afcd84 Removed redundant point.lua 2015-12-19 23:44:21 -05:00
Davis
8a3ee6a4fb Merge pull request #10 from davisdude/master
Added point.lua
2015-12-14 14:56:21 -05:00
Davis
2d075e32ff Fixed metamethods 2015-12-13 14:01:53 -05:00
Landon Manning
cda145629d I'm an idiot
the order in which a and b appear actually matters in add/sub.
2015-12-13 06:44:02 -04:00
Landon Manning
84999568e8 Merge branch 'master' of https://github.com/excessive/cpml
Conflicts:
	modules/octree.lua
2015-12-13 06:21:41 -04:00
Landon Manning
c72efbad3c buncha goodies
* Changed add/sub in vec2/vec3 to allow for integer math
* Fixed a string display error in quat
* Other stuff that @shakesoda probably did
2015-12-13 06:16:57 -04:00
Davis
8df04c0d73 Fixed string.format error 2015-12-11 23:44:26 -05:00
Davis
6b0be055b7 Added point.lua 2015-12-11 22:08:53 -05:00
Kyle McLamb
2cfea03fcc Remove dependency on lume
Since it was only used once it makes more sense just to inline that particular call
2015-12-08 13:16:42 -05:00
Colby Klein
c4a33434b2 Add cpml.quat.from_direction 2015-11-20 17:03:23 -08:00
Colby Klein
e5d0dc799c Add filter function to octree.draw_objects for debugging. 2015-11-20 01:50:48 -08:00
Landon Manning
0481a97195 Added ray casting to octree
* fixed octree API to match the rest of CPML
* standardized intersect inputs a bit more
2015-11-19 14:14:55 -04:00
Landon Manning
b51c6fc1be Added license info 2015-09-25 03:08:15 -03:00
Landon Manning
ab1d551b25 Added new octree implementation
reverted encapsulate_aabb intersect to be non-explicit
2015-09-25 02:54:38 -03:00
Landon Manning
2370daf5f3 Encapsulate should be explicit
inner needs to actually be inside outer, they cannot be the same size or
on the same plane(s).
2015-09-24 01:30:32 -03:00
Landon Manning
50edbb1b82 Added some intersects
* Added aabb_aabb
* Added encapsulate_aabb
* Changed point_aabb to take a min and max instead of position and
volume
* Removed boolean returns from line_line and segment_segment
2015-09-24 01:05:20 -03:00
Colby Klein
4a4ad08a35 Add vec2.lerp, tests, and fix some minor bugs.
- Added missing vec2 lerp (same as vec3's)
- Added lerp to vec2 and vec3 metatable
- Added tests for vec2 (incomplete)
- Fixed vec2/number being the same as number/vec2
- Fixed vec2 constructor to match vec3's
2015-09-15 07:05:22 -07:00
Colby Klein
951aea865f Proper fix for the quat.to_axis_angle bug.
Apparently, I was getting a number so close to -1 (but just under) that
it just printed as -1. Fuck off.
2015-09-14 13:35:01 -07:00
Colby Klein
18dd29d1b5 Work around math.acos(-1) returning NaN on LuaJIT... sometimes. 2015-09-14 13:26:05 -07:00
Colby Klein
6a5771348c Minor doc/test updates for vec3 2015-09-13 05:51:13 -07:00
Colby Klein
fb1778e45c Update vec3 docs 2015-09-11 13:39:19 -07:00
Colby Klein
78989682cf Add LDoc documentation. Utils done. 2015-09-11 07:59:05 -07:00
Landon Manning
449bf861d4 Added ability to divide a number over a vector.
Example: `local s = 1/scale`
2015-09-09 23:14:33 -03:00
airstruck
a4d611c227 fix tabs 2015-09-08 05:05:39 -04:00
airstruck
b50194bebc support negative values passed to frexp 2015-09-08 05:01:11 -04:00
Colby Klein
5081314be6 Missed a line. 2015-09-08 01:35:38 -07:00
Colby Klein
7257d1b343 Use our own frexp if it's not available (Lua 5.3+) 2015-09-08 01:33:19 -07:00
airstruck
ff33633b56 fix leaked globals 2015-09-02 18:43:12 -04:00
Colby Klein
9458738e11 Switch vec2*vec2 to per-component, add vec2.dot 2015-09-01 15:06:31 -07:00
Colby Klein
d198d7f97f Backout some FFI code - didn't work. 2015-08-25 11:10:18 -07:00
Colby Klein
cb41f1c4a7 Don't explode if the module has been hot reloaded.
Argh, struct redefinition errors. I'm glad that you can pcall this at
least.
2015-08-19 14:30:48 -07:00
Colby Klein
e6b9c84a6c Add utils.deadzone and threshold + tests 2015-08-15 01:19:44 -07:00
Colby Klein
54daab8ce2 Fix vec3 test failures, add unit vectors. 2015-08-15 01:06:32 -07:00
Colby Klein
6f050bd1c8 Add utils.smoothstep (smooth hermite interpolation) 2015-08-10 18:59:43 -07:00
Colby Klein
871c9246d0 Back vec2 and vec3 with FFI types if possible. 2015-08-10 18:56:48 -07:00
Colby Klein
9bc4d164dc Fix ray_aabb typos. 2015-08-10 17:59:32 -07:00
Colby Klein
d1dc50761f Fix mat4.look_at offset 2015-08-10 17:59:18 -07:00
Colby Klein
61e4c33852 Add mat4.hmd_perspective 2015-07-25 22:47:15 -07:00
Colby Klein
88e8ebc3de Add quaternion.unpack. Now vec2/3/quat all have it. 2015-07-25 19:31:14 -07:00
Colby Klein
59e844dd34 Remove vec3.tuple (again?). It's a dupe of unpack 2015-07-25 19:29:11 -07:00
Colby Klein
01f7aeeff9 Fix mat4.perspective 2015-07-25 19:27:07 -07:00
Colby Klein
1a90004e0d Add (VERY) experimental vec3-turbo, test stubs. 2015-07-25 07:21:16 -07:00
Colby Klein
2869d51035 Fix vec2/vec3.angle_to
I'm not sure of this is technically more correct, actually, but after
this fix I get the expected results.
2015-07-25 07:19:53 -07:00
Colby Klein
c102ded4ba Add operators and lerp to cpml.color 2015-07-25 07:17:50 -07:00
Landon Manning
6315124c6e Added intersections
* intersect.segment_segment(p1, p2, p3, p4)
* intersect.point_AABB(point, box)
2015-07-10 22:36:17 -03:00
Colby Klein
e6fdd92553 Add vec3.tuple, remove some dead code 2015-07-10 12:33:31 -07:00
Colby Klein
7cdca018aa Add quat.cross, fix quat.rotate, cleanup. 2015-07-10 12:25:39 -07:00