Mx Corey Frang
2b8371e5af
Rewrite isTouchingDrawables on CPU ( #263 )
...
* avoid gl.readPixels at all costs
2018-04-27 16:19:25 -04:00
DD
26f2039f39
We decided that it should not be the renderers responsibility to know a detail about how the paint editor works, and have the bitmap resolution passed in instead
2018-04-26 17:58:48 -04:00
DD Liu
d9c5b595a2
Merge pull request #264 from fsih/updateBitmap
...
Add updateBitmapSkin to renderer
2018-04-25 14:11:57 -04:00
DD
a49c455d9b
Update bitmap
2018-04-24 17:01:59 -04:00
Karishma Chadha
ac1f5564a3
Bitmap (+ double resolution) support.
2018-04-22 21:30:28 -04:00
Karishma Chadha
1f574d6ee3
Provide an api to get the calulated rotation center from the rendered costume
2018-04-20 00:01:41 -04:00
Paul Kaplan
bbcf6f73d3
Add method for getting the size of a skin by skin id.
...
Renamed the `getSkinSize` method to `getCurrentSkinSize`, since it was
using the drawables current skin. Added a new `getSkinSize` method that
works by skin id.
2018-04-10 10:00:54 -04:00
Paul Kaplan
e02cc5ae03
Merge pull request #248 from paulkaplan/fix-bubble-bounds
...
Add "get bounds for bubble" method.
2018-03-23 14:35:52 -04:00
Paul Kaplan
0b731b92a6
Add "get bounds for bubble" method.
...
Note there was an inconsequential coordinate flip in the original
transformation code, which was fixed in order for the sliced bounds to
work. The change is at line 388
2018-03-23 10:58:21 -04:00
Chris Willis-Ford
57d834c42e
Merge pull request #235 from mzgoddard/calc-transform-cache
...
Drawable _calculateTransform cache and inline work
2018-01-24 15:41:31 -08:00
Chris Willis-Ford
f8c781c163
Merge pull request #227 from cwillisf/use-browser-field
...
Update packaging to use UMD and the browser field
2018-01-24 15:21:16 -08:00
Michael "Z" Goddard
b59b5a3075
Put Drawable skin scale updating behind dirty flag
...
- Clean out "showing your work" in calculate transform
- Add comments on inline math blocks from twgl
2018-01-23 14:15:59 -05:00
Michael "Z" Goddard
46bc30e4ee
Inline most calculateTransform math
2018-01-23 14:14:38 -05:00
Michael "Z" Goddard
40ab1bd59d
Cache drawable's rotation matrix and rotation center vector
...
Building a rotation matrix needs to call trigonometry functions. Cache the
resulting matrix to save future time on non-rotation motion.
2018-01-23 14:14:01 -05:00
DD
d46cc4fec7
Merge branch 'develop' into pull231
2018-01-19 17:33:17 -05:00
DD
008abed073
correct case
2018-01-19 17:19:58 -05:00
Paul Kaplan
8a04fcd541
Cache image element in the SVG renderer.
2018-01-17 09:46:07 -05:00
Christopher Willis-Ford
89b5ed32d0
First pass at re-rasterizing SVGs when scaled
2018-01-17 01:05:44 -05:00
Christopher Willis-Ford
bc423cef46
Use require, not import, for SVG renderer
2018-01-12 13:12:55 -08:00
Christopher Willis-Ford
f45442f879
Merge branch 'develop' into extract-svg-renderer
2018-01-12 10:59:46 -08:00
Christopher Willis-Ford
413c1d8027
Extract svg-renderer out into a separate module
2018-01-12 10:56:28 -08:00
Chris Willis-Ford
89d09e9b98
Merge pull request #226 from cwillisf/check-for-webgl-support
...
Check & report if browser supports this renderer
2018-01-11 11:38:57 -08:00
Christopher Willis-Ford
7dd707db17
Revert getWebGLContext => getContext change
...
This change allowed TWGL to create a WebGL 2 context when available and
fall back to WebGL 1 when that's the only option. This should in theory
be harmless, but deserves more extensive testing before rolling it out.
2018-01-11 10:07:42 -08:00
Chris Willis-Ford
28983666fd
Merge pull request #228 from LLK/greenkeeper/twgl.js-4.4.0
...
chore(package): update twgl.js to version 4.4.0
2018-01-10 20:06:08 -08:00
Christopher Willis-Ford
a38c74c2c1
Fix Drawable's use of m4 for TWGL 4.x
...
The `create` method of `m4` has disappeared; call `identity` instead.
2018-01-10 18:22:57 -08:00
Christopher Willis-Ford
e958e4bfff
Fix playground, plus misc. cleanup
...
The playground was trying to build with a now-missing entry point.
Also, I fixed some JSDoc comments, added HTML labels, etc. until IDEA
had no meaningful complaints about `playground/index.html`.
2018-01-10 17:42:38 -08:00
Christopher Willis-Ford
63fc1c6f64
Update packaging to use UMD and the browser field
...
The web build is now packaged as UMD, and the `browser` field in
`package.json` now points to the web build output.
2018-01-10 12:58:10 -08:00
Christopher Willis-Ford
07a6ae57be
Check & report if browser supports this renderer
...
`RenderWebGL`'s constructor will now throw if TWGL init fails. There's
also a new static method to check whether or not we expect TWGL init to
succeed.
2018-01-10 12:28:54 -08:00
Paul Kaplan
ab05c9aa32
Merge pull request #225 from paulkaplan/fix-edge
...
Fix working on Edge
2018-01-10 14:52:35 -05:00
Paul Kaplan
4ce8b8f655
Do not change properties on bbox directly it throws errors in edge.
2018-01-10 13:56:49 -05:00
Paul Kaplan
140bab5965
Escape xml before putting user text into svg
2018-01-09 11:23:04 -05:00
Chris Willis-Ford
1afae3acbd
Merge pull request #204 from cwillisf/use-linear-filtering
...
Use bilinear filtering except when we shouldn't
2017-12-11 11:54:57 -08:00
Paul Kaplan
43aa62e747
Update comment
2017-12-11 09:15:24 -05:00
Christopher Willis-Ford
96f416467d
Remove 3 unnecessary blank lines
2017-12-08 16:36:04 -08:00
Paul Kaplan
1c4e166aa8
Return false instead of undefined
2017-12-08 12:38:04 -05:00
Paul Kaplan
7bb15c7444
Ignore sprite visibility for touching color
2017-12-08 12:27:45 -05:00
Paul Kaplan
8f3254470a
Filter out drawables that are not visible.
2017-12-07 15:05:43 -05:00
Christopher Willis-Ford
61c75172d0
Remember: no Hungarian
2017-12-06 15:28:41 -08:00
Christopher Willis-Ford
408b259055
Simplify & document RGB->HSL conversion
2017-12-05 11:01:12 -08:00
Christopher Willis-Ford
e83673ffb8
Increase epsilon for RGB2HCV to fix mobile NaN
...
Some mobile GPUs end up dividing by "zero" with the previous epsilon
value. The larger epsilon doesn't cause any problems on systems which
didn't exhibit the bug (like my main dev machine).
2017-12-04 15:31:18 -08:00
Paul Kaplan
cde61630ab
Merge pull request #207 from paulkaplan/double-render
...
Fix double render issue by clearing canvas just before drawing
2017-12-01 11:46:34 -05:00
Paul Kaplan
101b74455c
Clear the canvas just before the image is ready to draw.
2017-12-01 10:22:35 -05:00
Paul Kaplan
8a1f3306b7
Check if x has been incremented to OR above the width.
...
Fixes a bug with the convex hull calculation where the bounds could not
be calculated for certain costumes with non-integer sizes.
2017-12-01 08:56:12 -05:00
Christopher Willis-Ford
9307e09031
Use bilinear filtering except when we shouldn't
...
Use bilinear filtering unless the Drawable is angled by a multiple of 90
degrees and is either a raster image (like a BitmapSkin) or is around
its native resoluion. This makes both bitmaps and vectors look better in
most cases. This is roughly the same logic that Scratch 2.0 used; we may
want to tweak it over time to see if we can make it even better.
2017-11-29 20:55:50 -08:00
Chris Willis-Ford
72af98d2cf
Merge pull request #193 from griffpatch/touching-color-white
...
Touching color white always returns "true"
2017-11-20 17:25:42 -08:00
Chris Willis-Ford
8495c6c4e2
Merge pull request #196 from mzgoddard/alpha-shape
...
Emulate silhouette rendering for pick and _getConvexHullPointsForDrawable
2017-11-20 13:29:39 -08:00
Michael "Z" Goddard
59f6492742
Use isTouching methods in RenderWebGL.pick and getConvexHull
...
Use Drawable.isTouching and Skin.isTouching to implement pick and
_getConvexHullPointsForDrawable to emulate rendering the drawable's
silhouette and determining what is picked or the points for a convex
hull.
2017-11-20 14:00:37 -05:00
Michael "Z" Goddard
8bdf56705e
Add Drawable.isTouching
...
Use EffectTransform and Skin.isTouching to implement
Drawable.isTouching.
Drawable.isTouching takes a world coordinate.
2017-11-20 13:46:34 -05:00
Chris Willis-Ford
77e3d63da9
Merge pull request #195 from mzgoddard/whirl-fisheye-without-condition
...
Whirl and Fisheye shaders without conditions
2017-11-16 16:47:17 -08:00
griffpatch
10762c7f7c
Fix misunderstanding of mask3b now that I can bypass the build failure and test
2017-11-16 08:33:10 +00:00