Commit Graph

88 Commits

Author SHA1 Message Date
Ben Cragg aa7ef59ecd wip line tests 2019-04-03 11:47:36 +01:00
Ben Cragg eb3d7e0787 wip line tests 2019-04-03 11:09:14 +01:00
Ben Cragg 11e2012ef5 WIP line tests 2019-04-03 08:23:34 +01:00
Ben Cragg 8cd352b7a3 WIP line tests 2019-04-03 08:13:33 +01:00
Ben Cragg 997f23dfb5 WIP line tests 2019-04-02 17:01:18 +01:00
Ben Cragg 04c3ef72a3 WIP line tests 2019-04-02 16:27:54 +01:00
Ben Cragg 9d07d69429 Fixed so corners are provided in anticlockwise pattern 2019-04-01 15:42:20 +01:00
Ben Cragg 128ec4d4c0 Added function to create a Line 2019-04-01 15:37:23 +01:00
Ben Cragg d3912a6486 Added Line struct and methods 2019-04-01 15:31:20 +01:00
Ben Cragg 680d16c17b Corrected returned Vectors for corner overlaps 2019-02-18 12:03:54 +00:00
Ben Cragg cc9f03d393 corrected function preambles 2019-02-14 14:23:50 +00:00
Ben Cragg f21c48599f Made naming consistent 2019-02-14 14:23:50 +00:00
Ben Cragg ab70533793 wip 2019-02-14 14:23:50 +00:00
Ben Cragg 0a0c8ff110 corrected area formula 2019-02-14 14:23:50 +00:00
Ben Cragg 5abf2d29a6 swapped radius and center order 2019-02-14 14:23:50 +00:00
Ben Cragg 4d30a8fe49 fixed intersect function 2019-02-14 14:23:50 +00:00
Ben Cragg ecda96a36f removed unneeded Min call 2019-02-14 14:23:50 +00:00
Ben Cragg e225e9a1ef corrected comment 2019-02-14 14:23:50 +00:00
Ben Cragg 13171c409b using Lerp 2019-02-14 14:23:50 +00:00
Ben Cragg 23168ee324 remove local var 2019-02-14 14:23:50 +00:00
Ben Cragg 44d030b9ca normalising before getting bigger/smaller 2019-02-14 14:23:50 +00:00
Ben Cragg b06a31baa3 Removed Diameter function 2019-02-14 14:23:50 +00:00
Ben Cragg 4c6d061455 added rect-circle intersection functions 2019-02-14 14:23:50 +00:00
Ben Cragg 16722d55e1 not exporting circle size comparisons 2019-02-14 14:22:52 +00:00
Ben Cragg ee24eeb67d fixed circle.Intersect 2019-02-14 14:22:52 +00:00
Ben Cragg 5072f34b91 Added Circle geometry and tests 2019-02-14 14:22:52 +00:00
Jacek Olszak 2e0da4f44a #159 Another reduction of Simplify Matrix.Unproject formulas 2019-02-12 21:06:37 +01:00
Jacek Olszak b0ed22e0ec #159 Simplify Matrix.Unproject formulas 2019-02-12 21:00:05 +01:00
Jacek Olszak 1e19db5b25 #159 Add test case when matrix determinant is not 1 2019-02-12 18:40:15 +01:00
Jacek Olszak cabaee680e #159 Fix unproject for rotated matrix 2019-02-12 14:57:03 +01:00
Stephen Michaelis 8d20deea05 update MouseEntered to MouseInsideWindow 2019-01-21 17:13:51 -05:00
Stephen Michaelis e7a625f5d2 updated Floor method 2019-01-20 10:00:35 -05:00
Stephen Michaelis d3f6331240 Adding a pixel.Vec Floor method to geometry.go 2019-01-20 09:56:30 -05:00
NaniteFactory abfdf18fb6 fix typo for matrix 2018-09-05 12:53:25 +09:00
faiface 721a10ef10 add Vec.Project 2017-10-15 19:50:41 +02:00
faiface c87741300d add pixel.Unit 2017-10-15 19:43:12 +02:00
faiface 62cefc262e add pixel.Clamp 2017-10-15 19:42:13 +02:00
faiface ce09bb1114 fix Matrix.Chained (wrong order of composition) 2017-09-04 00:40:12 +02:00
faiface 7c5e5588e2 fix Vec.Normal to rotate by pi/2, not -pi/2 2017-08-29 20:23:32 +02:00
Alex 3e3a9aaa48 fix operation order for rectangle resize function, add tests 2017-07-29 00:40:06 +12:00
faiface e64d97efb1 fix Rect.Intersect 2017-07-05 20:36:25 +02:00
faiface da52aa25ec clarify Rect.Intersect doc 2017-07-05 19:58:09 +02:00
faiface 69d4a37e5e add Rect.Intersect 2017-07-05 19:54:30 +02:00
faiface 2b9b4d07c4 add Rect.Area 2017-07-05 19:54:18 +02:00
faiface 886e7fa22a another minor code style change 2017-06-11 14:14:02 +02:00
faiface 99a43ec1a9 minor code style change 2017-06-11 14:06:45 +02:00
faiface d4cd1c33e2 one more tiny doc change 2017-06-11 01:18:23 +02:00
faiface 51cd0314d5 minor doc changes 2017-06-11 01:17:37 +02:00
Seebs daedc45ea9 Improve normal calculations
Soooo. It turns out that the bunch of smallish (~4-5% of runtime)
loads associated with Len(), Unit(), Rotated(), and so on... Were
actually more like 15% or more of computational effort. I first
figured this out by creating:

	func (u Vec) Normal(v Vec) Vec

which gives you a vector normal to u->v. That consumed a lot
of CPU time, and was followed by .Unit().Scaled(imd.thickness / 2),
which consumed a bit more CPU time.

After some poking, and in the interests of avoiding UI cruft,
the final selection is
	func (u Vec) Normal() Vec

This returns the vector rotated 90 degrees, which turns out to
be the most common problem.
2017-06-10 17:55:16 -05:00
faiface c0766504e3 minor, mostly stylistic, changes 2017-06-09 18:13:05 +02:00