105 Commits

Author SHA1 Message Date
karai17
4f9bc17bf4 Refactored mat4
Did some tidying up on quat, vec2, vec3, and utils
2016-07-19 23:55:21 -03:00
karai17
f9d31b20fb Fixed a typo 2016-07-18 06:21:43 -03:00
karai17
46f8261ea0 Refactored mat4 (in progress)
Cleaned up vec2, vec3, quat
2016-07-18 06:17:42 -03:00
karai17
add0a71c05 Added tests for vec2 and vec3 2016-07-15 22:07:48 -03:00
Colby Klein
7f7ff0077a Fix mat4 typos. 2016-04-13 21:57:39 -07:00
Bobbyjoness
ffe3d4b083 Fixed redundant requiring of ffi 2016-01-01 21:58:38 -05:00
Landon Manning
1033713b33 added DBL_EPSILON 2015-12-29 05:42:25 -04:00
Landon Manning
5da09ddd8b removed ray_triangle2, it was too slow
also moved some vec3 definitions outside their respective function
bodies to speed thing sup and create less garbage
2015-12-29 04:58:53 -04:00
Landon Manning
c42a3efc07 Added conversion between polar and cartesian coordinates 2015-12-28 19:26:19 -04:00
Landon Manning
2347bd9706 Looks like we don't need quat.div after all. 2015-12-28 12:40:52 -04:00
Landon Manning
e9b00c2b71 Reduced garbage 2015-12-28 12:15:19 -04:00
Matthew Blanchard
f4163b9893 Pruned mat4. Added quat.mul_vec3. 2015-12-28 11:11:45 -05:00
Landon Manning
55685bedcc Added second ray_triangle function for performance testing
We should exercise both to see which performs better.
2015-12-28 12:02:22 -04:00
Landon Manning
437ac9135e Reimplemented quat*vec3, quat/quat, and quat/number
Fixed a few minor things in vec2 and vec3
2015-12-28 10:15:05 -04:00
Matthew Blanchard
8c9214764e Fixed a small bug in vec2. 2015-12-25 22:19:53 -05:00
Matthew Blanchard
85655e65af Refactored quat and added doc comments. Fixed some small typos and doc comments in vec2. 2015-12-25 20:06:31 -05:00
Matthew Blanchard
c60a324010 Fixed some small holdovers from vec3 remaining in vec2. 2015-12-25 18:44:03 -05:00
Matthew Blanchard
c5d02e0683 Updated vec3 doc comments. Brought vec2 in line with vec3. Doc commented vec2. 2015-12-25 18:35:03 -05:00
Matthew Blanchard
4302b2b5dc Added unit vectors. 2015-12-24 16:49:21 -05:00
Matthew Blanchard
2b35d4ae57 Removed defaults. Added trim. Reworked __call so it works correctly. Made all functions return out. 2015-12-24 16:46:58 -05:00
Matthew Blanchard
6116576ad0 Fixed a small typo in vec3 2015-12-23 04:50:53 -05:00
Matthew Blanchard
94ef22b643 Fixed issues with ffi and cloning.
Fixed the ffi check to now work correctly and moved the ffi local up a
scope so that it could be used later in the file. Made clone simply call
new().
2015-12-23 03:19:09 -05:00
Matthew Blanchard
bb78a486b0 Fixed merge conflicts. Refactored reflect and refract. 2015-12-22 18:05:39 -05:00
Matthew Blanchard
57704e9dba Added standard Lua fallback and documentation. 2015-12-22 17:55:59 -05:00
Landon Manning
71af8f5498 Rewrote quaternion module
Untested, but I hope it works!
2015-12-22 05:27:22 -04:00
Colby Klein
b9e004dc1a Add vec3.reflect and vec3.refract 2015-12-20 22:55:38 -08:00
Colby Klein
82f336a7f4 Fix broken vec2/vec3 clone. 2015-12-20 22:38:36 -08:00
Matthew Blanchard
5a9aabadb5 Revert "Added simple object and shape constructors"
This reverts commit 10f472771b00b79a479ab54c879f10d234197166.
2015-12-20 22:40:33 -05:00
Landon Manning
10f472771b Added simple object and shape constructors
ray, aabb, obb, plane, sphere, line, triangle
2015-12-20 22:35:06 -04:00
Landon Manning
7143dcadae Wrote cpml instead of vec3 in some places 2015-12-20 20:54:57 -04:00
Landon Manning
870a3c5129 Updated vec2 to match new vec3
Fixed code consistency in vec3 as well.
2015-12-20 06:09:09 -04:00
Landon Manning
8b136798d2 Updated intersect to use new vec3
Improved code consistency as well.
2015-12-20 05:24:28 -04:00
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