pgl 0.0.6 → 5.0.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/LICENSE.md +20 -0
- package/README.md +46 -11
- package/dist/cli-run.d.ts +3 -0
- package/dist/cli-run.d.ts.map +1 -0
- package/dist/cli-run.js +7 -0
- package/dist/cli-run.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/fwd/@dataplan/json/index.d.ts +1 -0
- package/fwd/@dataplan/json/index.js +1 -0
- package/fwd/@dataplan/pg/adaptors/pg/index.d.ts +1 -0
- package/fwd/@dataplan/pg/adaptors/pg/index.js +1 -0
- package/fwd/@dataplan/pg/index.d.ts +1 -0
- package/fwd/@dataplan/pg/index.js +1 -0
- package/fwd/grafast/envelop/index.d.ts +1 -0
- package/fwd/grafast/envelop/index.js +1 -0
- package/fwd/grafast/graphql/index.d.ts +1 -0
- package/fwd/grafast/graphql/index.js +1 -0
- package/fwd/grafast/index.d.ts +1 -0
- package/fwd/grafast/index.js +1 -0
- package/fwd/grafserv/express/v4/index.d.ts +1 -0
- package/fwd/grafserv/express/v4/index.js +1 -0
- package/fwd/grafserv/fastify/v4/index.d.ts +1 -0
- package/fwd/grafserv/fastify/v4/index.js +1 -0
- package/fwd/grafserv/index.d.ts +1 -0
- package/fwd/grafserv/index.js +1 -0
- package/fwd/grafserv/koa/v2/index.d.ts +1 -0
- package/fwd/grafserv/koa/v2/index.js +1 -0
- package/fwd/grafserv/node/index.d.ts +1 -0
- package/fwd/grafserv/node/index.js +1 -0
- package/fwd/grafserv/ruru/cli/index.d.ts +1 -0
- package/fwd/grafserv/ruru/cli/index.js +1 -0
- package/fwd/grafserv/ruru/index.d.ts +1 -0
- package/fwd/grafserv/ruru/index.js +1 -0
- package/fwd/grafserv/ruru/server/index.d.ts +1 -0
- package/fwd/grafserv/ruru/server/index.js +1 -0
- package/fwd/graphile-build/index.d.ts +2 -0
- package/fwd/graphile-build/index.js +1 -0
- package/fwd/graphile-build-pg/index.d.ts +1 -0
- package/fwd/graphile-build-pg/index.js +1 -0
- package/fwd/graphile-build-pg/pg-introspection/index.d.ts +1 -0
- package/fwd/graphile-build-pg/pg-introspection/index.js +1 -0
- package/fwd/pg-sql2/index.d.ts +1 -0
- package/fwd/pg-sql2/index.js +1 -0
- package/fwd/postgraphile/presets/amber/index.d.ts +1 -0
- package/fwd/postgraphile/presets/amber/index.js +1 -0
- package/fwd/postgraphile/presets/relay/index.d.ts +1 -0
- package/fwd/postgraphile/presets/relay/index.js +1 -0
- package/fwd/postgraphile/presets/v4/index.d.ts +1 -0
- package/fwd/postgraphile/presets/v4/index.js +1 -0
- package/fwd/postgraphile/utils/index.d.ts +1 -0
- package/fwd/postgraphile/utils/index.js +1 -0
- package/fwd/tamedevil/index.d.ts +1 -0
- package/fwd/tamedevil/index.js +1 -0
- package/package.json +202 -12
- package/.npmignore +0 -2
- package/LICENSE +0 -21
- package/examples/cube.js +0 -97
- package/examples/points.js +0 -82
- package/examples/shaders/flat-surface.fshader +0 -5
- package/examples/shaders/flat-surface.vshader +0 -72
- package/examples/shaders/matrices.fshader +0 -5
- package/examples/shaders/matrices.vshader +0 -12
- package/examples/shaders/model-and-view.fshader +0 -5
- package/examples/shaders/model-and-view.vshader +0 -23
- package/examples/shaders/pgl.fshader +0 -5
- package/examples/shaders/pgl.vshader +0 -53
- package/examples/shaders/simple.fshader +0 -5
- package/examples/shaders/simple.vshader +0 -8
- package/index.js +0 -25
- package/lib/camera.js +0 -222
- package/lib/geom.js +0 -256
- package/lib/light.js +0 -27
- package/lib/line.js +0 -10
- package/lib/mesh.js +0 -266
- package/lib/pgl-utils.js +0 -76
- package/lib/plask-utils.js +0 -46
- package/lib/renderer.js +0 -418
- package/lib/scene.js +0 -167
- package/lib/triangle.js +0 -73
- package/lib/vertex.js +0 -17
- package/test/index.js +0 -53
package/test/index.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
var assert = require('assert');
|
|
3
|
-
var pglUtils = require('../lib/pgl-utils.js');
|
|
4
|
-
|
|
5
|
-
describe('pglUtils.merge: Merge arguments passed in to a function with a defaults object', function() {
|
|
6
|
-
var args = {
|
|
7
|
-
text : 'overridden',
|
|
8
|
-
arr : [1,2,3]
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
var defs = {
|
|
12
|
-
text : 'default',
|
|
13
|
-
arr : [3,2,1],
|
|
14
|
-
num : 1
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var testMerge = pglUtils.merge(args, defs);
|
|
18
|
-
|
|
19
|
-
var obj = {
|
|
20
|
-
text : 'overridden',
|
|
21
|
-
arr : [1,2,3],
|
|
22
|
-
num : 1
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
it('should override the defaults if arguments exists', function() {
|
|
26
|
-
assert.equal(obj.text, args.text);
|
|
27
|
-
assert.deepEqual(obj.arr, args.arr);
|
|
28
|
-
assert.equal(obj.num, defs.num);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
describe('pglUtils.geoCarte: Converting geo coordinates to Cartesian', function() {
|
|
33
|
-
var geoCoords = [ [50.8429, 0.1313], [-20.5878, -174.8103], [50.8429, 0.1313] ];
|
|
34
|
-
|
|
35
|
-
var cartCoords = [];
|
|
36
|
-
cartCoords[0] = pglUtils.geoCarte(geoCoords[0][0], geoCoords[0][1]);
|
|
37
|
-
cartCoords[1] = pglUtils.geoCarte(geoCoords[1][0], geoCoords[1][1]);
|
|
38
|
-
cartCoords[2] = pglUtils.geoCarte(geoCoords[2][0], geoCoords[2][1]);
|
|
39
|
-
|
|
40
|
-
it('should calculate the correct location', function() {
|
|
41
|
-
assert.equal(cartCoords[0][0], 4035587.0474534836);
|
|
42
|
-
assert.equal(cartCoords[0][1], 9248.03731408002);
|
|
43
|
-
assert.equal(cartCoords[0][2], 4922527.464350282);
|
|
44
|
-
|
|
45
|
-
assert.equal(cartCoords[1][0], -5948780.075425479);
|
|
46
|
-
assert.equal(cartCoords[1][1], -540303.152057656);
|
|
47
|
-
assert.equal(cartCoords[1][2], -2228731.2513984353);
|
|
48
|
-
|
|
49
|
-
assert.equal(cartCoords[2][0], 4035587.0474534836);
|
|
50
|
-
assert.equal(cartCoords[2][1], 9248.03731408002);
|
|
51
|
-
assert.equal(cartCoords[2][2], 4922527.464350282);
|
|
52
|
-
});
|
|
53
|
-
});
|