Comparing version 0.12.0 to 0.13.0
{ | ||
"name": "aura", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"author": "optionallychained", | ||
@@ -36,3 +36,3 @@ "license": "MIT", | ||
"engine:publish": "tsc --project ./tsconfig.publish.json", | ||
"prepublishOnly": "npm run docs:deploy && npm run engine:dist && npm run engine:publish" | ||
"prepublishOnly": "npm run engine:dist && npm run engine:publish" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.BOX = new geometry_1.Geometry({ | ||
name: 'box_2d', | ||
name: 'box', | ||
vertices: Float32Array.from([ | ||
@@ -13,0 +13,0 @@ -0.5, -0.5, |
export * from './box.geometry.2d'; | ||
export * from './circle.geometry.2d'; | ||
export * from './f.geometry.2d'; | ||
export * from './hexagon.geometry.2d'; | ||
export * from './line.geometry.2d'; | ||
export * from './octagon.geometry.2d'; | ||
export * from './pentagon.geometry.2d'; | ||
export * from './point.geometry.2d'; | ||
export * from './polygon.geometry.2d'; | ||
export * from './triangle.geometry.2d'; | ||
export * from './triangleright.geometry.2d'; | ||
export * as Wireframe from './wireframe'; |
@@ -15,5 +15,12 @@ "use strict"; | ||
__exportStar(require("./box.geometry.2d"), exports); | ||
__exportStar(require("./circle.geometry.2d"), exports); | ||
__exportStar(require("./f.geometry.2d"), exports); | ||
__exportStar(require("./hexagon.geometry.2d"), exports); | ||
__exportStar(require("./line.geometry.2d"), exports); | ||
__exportStar(require("./octagon.geometry.2d"), exports); | ||
__exportStar(require("./pentagon.geometry.2d"), exports); | ||
__exportStar(require("./point.geometry.2d"), exports); | ||
__exportStar(require("./polygon.geometry.2d"), exports); | ||
__exportStar(require("./triangle.geometry.2d"), exports); | ||
__exportStar(require("./triangleright.geometry.2d"), exports); | ||
exports.Wireframe = require("./wireframe"); |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.LINE = new geometry_1.Geometry({ | ||
name: 'line_2d', | ||
name: 'line', | ||
vertices: Float32Array.from([ | ||
@@ -20,6 +20,4 @@ -0.5, 0, | ||
textureCoordinates: Float32Array.from([ | ||
// TODO janky, do we want texture coordinates for lines? | ||
0, 0, | ||
1, 0 | ||
// TODO consider whether or not texcoords make sense for lines | ||
]) | ||
}); |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.POINT = new geometry_1.Geometry({ | ||
name: 'point_2d', | ||
name: 'point', | ||
vertices: Float32Array.from([ | ||
@@ -19,5 +19,4 @@ 0, 0 | ||
textureCoordinates: Float32Array.from([ | ||
// TODO janky, do we want texture coordinates for points? | ||
0.5, 0.5 | ||
// TODO consider whether or not texcoords make sense for points | ||
]) | ||
}); |
import { Geometry } from '../geometry'; | ||
/** | ||
* Built-in 2D Triangle Geometry, setting out the information required to render triangles | ||
*/ | ||
export declare const TRIANGLE: Geometry; |
@@ -7,10 +7,11 @@ "use strict"; | ||
/** | ||
* Built-in 2D Triangle Geometry, setting out the information required to render triangles | ||
* Built-in 2D Triangle Geometry, setting out the information required to render equilateral triangles | ||
*/ | ||
var h = Math.sqrt(3) / 4; | ||
exports.TRIANGLE = new geometry_1.Geometry({ | ||
name: 'triangle_2d', | ||
name: 'triangle_equilateral', | ||
vertices: Float32Array.from([ | ||
-0.5, -0.5, | ||
0.5, -0.5, | ||
0, 0.5 | ||
-0.5, -h, | ||
0.5, -h, | ||
0, h, | ||
]), | ||
@@ -17,0 +18,0 @@ vertexSize: 2, |
import { Geometry } from '../../geometry'; | ||
/** | ||
* Built-in 2D Wireframe box Geometry, setting out the information required to render wireframe quads | ||
* Built-in 2D Wireframe Box Geometry, setting out the information required to render wireframe quads | ||
*/ | ||
export declare const BOX: Geometry; |
@@ -7,6 +7,6 @@ "use strict"; | ||
/** | ||
* Built-in 2D Wireframe box Geometry, setting out the information required to render wireframe quads | ||
* Built-in 2D Wireframe Box Geometry, setting out the information required to render wireframe quads | ||
*/ | ||
exports.BOX = new geometry_1.Geometry({ | ||
name: 'box_2d_wireframe', | ||
name: 'box_wireframe', | ||
vertices: Float32Array.from([ | ||
@@ -22,8 +22,4 @@ -0.5, -0.5, | ||
textureCoordinates: Float32Array.from([ | ||
// TODO janky...do we even want texturing for wireframes? | ||
0, 0, | ||
1, 0, | ||
1, 1, | ||
0, 1 | ||
// TODO consider whether or not texcoords make sense for lines | ||
]) | ||
}); |
export * from './box.wireframe.geometry.2d'; | ||
export * from './circle.wireframe.geometry.2d'; | ||
export * from './f.wireframe.geometry.2d'; | ||
export * from './hexagon.wireframe.geometry.2d'; | ||
export * from './octagon.wireframe.geometry.2d'; | ||
export * from './pentagon.wireframe.geometry.2d'; | ||
export * from './polygon.wireframe.geometry.2d'; | ||
export * from './triangle.wireframe.geometry.2d'; | ||
export * from './triangleright.wireframe.geometry.2d'; |
@@ -14,2 +14,9 @@ "use strict"; | ||
__exportStar(require("./box.wireframe.geometry.2d"), exports); | ||
__exportStar(require("./circle.wireframe.geometry.2d"), exports); | ||
__exportStar(require("./f.wireframe.geometry.2d"), exports); | ||
__exportStar(require("./hexagon.wireframe.geometry.2d"), exports); | ||
__exportStar(require("./octagon.wireframe.geometry.2d"), exports); | ||
__exportStar(require("./pentagon.wireframe.geometry.2d"), exports); | ||
__exportStar(require("./polygon.wireframe.geometry.2d"), exports); | ||
__exportStar(require("./triangle.wireframe.geometry.2d"), exports); | ||
__exportStar(require("./triangleright.wireframe.geometry.2d"), exports); |
import { Geometry } from '../../geometry'; | ||
/** | ||
* Built-in 2D Wireframe Triangle Geometry, setting out the information required to render wireframe triangles | ||
*/ | ||
export declare const TRIANGLE: Geometry; |
@@ -7,10 +7,11 @@ "use strict"; | ||
/** | ||
* Built-in 2D Wireframe Triangle Geometry, setting out the information required to render wireframe triangles | ||
* Built-in 2D Wireframe Triangle Geometry, setting out the information required to render wireframe equilateral triangles | ||
*/ | ||
var h = Math.sqrt(3) / 4; | ||
exports.TRIANGLE = new geometry_1.Geometry({ | ||
name: 'triangle_2d_wireframe', | ||
name: 'triangle_equilateral_wireframe', | ||
vertices: Float32Array.from([ | ||
-0.5, -0.5, | ||
0.5, -0.5, | ||
0, 0.5 | ||
-0.5, -h, | ||
0.5, -h, | ||
0, h | ||
]), | ||
@@ -21,7 +22,4 @@ vertexSize: 2, | ||
textureCoordinates: Float32Array.from([ | ||
// TODO janky...do we even want texturing for wireframes? | ||
0, 0, | ||
1, 0, | ||
0.5, 1 | ||
// TODO consider whether or not texcoords make sense for lines | ||
]) | ||
}); |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.BOX = new geometry_1.Geometry({ | ||
name: 'box_3d', | ||
name: 'box', | ||
vertices: Float32Array.from([ | ||
@@ -28,8 +28,8 @@ // front face | ||
// back face | ||
0.5, -0.5, -0.5, | ||
-0.5, -0.5, -0.5, | ||
-0.5, 0.5, -0.5, | ||
-0.5, 0.5, -0.5, | ||
0.5, 0.5, -0.5, | ||
0.5, -0.5, -0.5, | ||
0.5, 0.5, -0.5, | ||
0.5, 0.5, -0.5, | ||
-0.5, 0.5, -0.5, | ||
-0.5, -0.5, -0.5, | ||
// top face | ||
@@ -43,15 +43,15 @@ -0.5, 0.5, 0.5, | ||
// right face | ||
0.5, -0.5, 0.5, | ||
0.5, -0.5, -0.5, | ||
0.5, 0.5, -0.5, | ||
0.5, 0.5, -0.5, | ||
0.5, 0.5, 0.5, | ||
0.5, -0.5, 0.5, | ||
0.5, 0.5, 0.5, | ||
0.5, 0.5, 0.5, | ||
0.5, 0.5, -0.5, | ||
0.5, -0.5, -0.5, | ||
// bottom face | ||
0.5, -0.5, 0.5, | ||
-0.5, -0.5, 0.5, | ||
0.5, -0.5, 0.5, | ||
-0.5, -0.5, -0.5, | ||
-0.5, -0.5, -0.5, | ||
0.5, -0.5, -0.5, | ||
0.5, -0.5, -0.5, | ||
-0.5, -0.5, -0.5, | ||
-0.5, -0.5, 0.5 | ||
0.5, -0.5, 0.5 | ||
]), | ||
@@ -58,0 +58,0 @@ vertexSize: 3, |
export * from './box.geometry.3d'; | ||
export * from './f.geometry.3d'; | ||
export * from './line.geometry.3d'; | ||
export * from './octahedron.geometry.3d'; | ||
export * from './point.geometry.3d'; | ||
export * from './prismHexagonal.geometry.3d'; | ||
export * from './prismTriangular.geometry.3d'; | ||
export * from './pyramidSquare.geometry.3d'; | ||
export * from './pyramidHexagonal.geometry.3d'; | ||
export * from './tetrahedron.geometry.3d'; | ||
export * as Wireframe from './wireframe'; |
@@ -15,4 +15,11 @@ "use strict"; | ||
__exportStar(require("./box.geometry.3d"), exports); | ||
__exportStar(require("./f.geometry.3d"), exports); | ||
__exportStar(require("./line.geometry.3d"), exports); | ||
__exportStar(require("./octahedron.geometry.3d"), exports); | ||
__exportStar(require("./point.geometry.3d"), exports); | ||
__exportStar(require("./prismHexagonal.geometry.3d"), exports); | ||
__exportStar(require("./prismTriangular.geometry.3d"), exports); | ||
__exportStar(require("./pyramidSquare.geometry.3d"), exports); | ||
__exportStar(require("./pyramidHexagonal.geometry.3d"), exports); | ||
__exportStar(require("./tetrahedron.geometry.3d"), exports); | ||
exports.Wireframe = require("./wireframe"); |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.LINE = new geometry_1.Geometry({ | ||
name: 'line_3d', | ||
name: 'line', | ||
vertices: Float32Array.from([ | ||
@@ -20,6 +20,4 @@ -0.5, 0, 0, | ||
textureCoordinates: Float32Array.from([ | ||
// TODO janky, do we want texture coordinates for lines? | ||
0, 0, | ||
1, 0 | ||
// TODO consider whether or not texcoords make sense for lines | ||
]) | ||
}); |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.POINT = new geometry_1.Geometry({ | ||
name: 'point_3d', | ||
name: 'point', | ||
vertices: Float32Array.from([ | ||
@@ -19,5 +19,4 @@ 0, 0, 0 | ||
textureCoordinates: Float32Array.from([ | ||
// TODO janky, do we want texture coordinates for points? | ||
0.5, 0.5 | ||
// TODO consider whether or not texcoords make sense for points | ||
]) | ||
}); |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.BOX = new geometry_1.Geometry({ | ||
name: 'box_3d_wireframe', | ||
name: 'box_wireframe', | ||
vertices: Float32Array.from([ | ||
@@ -48,34 +48,4 @@ // front face | ||
textureCoordinates: Float32Array.from([ | ||
// TODO janky...do we even want texturing for wireframes? | ||
// front face | ||
0, 0, | ||
1, 0, | ||
1, 0, | ||
1, 1, | ||
1, 1, | ||
0, 1, | ||
0, 1, | ||
0, 0, | ||
// back face | ||
0, 0, | ||
1, 0, | ||
1, 0, | ||
1, 1, | ||
1, 1, | ||
0, 1, | ||
0, 1, | ||
0, 0, | ||
// bottom left connector | ||
0, 0, | ||
1, 0, | ||
// bottom right connector | ||
0, 0, | ||
1, 0, | ||
// top right connector | ||
0, 1, | ||
1, 1, | ||
// top left connector | ||
0, 1, | ||
1, 1 | ||
// TODO consider whether or not texcoords make sense for lines | ||
]) | ||
}); |
export * from './box.wireframe.geometry.3d'; | ||
export * from './f.wireframe.geometry.3d'; | ||
export * from './octahedron.wireframe.geometry.3d'; | ||
export * from './prismHexagonal.wireframe.geometry'; | ||
export * from './prismTriangular.wireframe.geometry.3d'; | ||
export * from './pyramidHexagonal.wireframe.geometry.3d'; | ||
export * from './pyramidSquare.wireframe.geometry.3d'; | ||
export * from './tetrahedron.wireframe.geometry.3d'; |
@@ -14,1 +14,8 @@ "use strict"; | ||
__exportStar(require("./box.wireframe.geometry.3d"), exports); | ||
__exportStar(require("./f.wireframe.geometry.3d"), exports); | ||
__exportStar(require("./octahedron.wireframe.geometry.3d"), exports); | ||
__exportStar(require("./prismHexagonal.wireframe.geometry"), exports); | ||
__exportStar(require("./prismTriangular.wireframe.geometry.3d"), exports); | ||
__exportStar(require("./pyramidHexagonal.wireframe.geometry.3d"), exports); | ||
__exportStar(require("./pyramidSquare.wireframe.geometry.3d"), exports); | ||
__exportStar(require("./tetrahedron.wireframe.geometry.3d"), exports); |
@@ -80,2 +80,5 @@ "use strict"; | ||
get: function () { | ||
// TODO consider making texcoords optional alongside thoughts on validity of point + line texture sampling | ||
// associated thinking: if texcoords become optional, an implicit constraint is placed upon Entity construction which may be | ||
// difficult to communicate or enforce (Texture Components only compatible with Models/Geometries with texcoords) | ||
return this.config.textureCoordinates; | ||
@@ -82,0 +85,0 @@ }, |
@@ -83,9 +83,6 @@ import { Game } from '../core'; | ||
/** | ||
* Rendering mode switching routine; receives a State's rendering mode, indicating a transition towards either 2D or 3D rendering, and | ||
* configures WebGL to render in the mode if it's different than the last one | ||
* Extra WebGL state configuation for specific 2D and 3D related state | ||
* | ||
* Effectively allows a Game to comprise both 2D and 3D States | ||
* | ||
* @param mode the mode to switch to | ||
// */ | ||
* // TODO make this configurable | ||
*/ | ||
setRenderingMode(mode: '2D' | '3D'): void; | ||
@@ -105,5 +102,5 @@ /** | ||
/** | ||
* Internal-use one-time WebGL configuration routine; set flags and enable features once at application initialisation | ||
* One-time WebGL global state configuration, where configurations apply to both 2D and 3D rendering modes | ||
* | ||
* // TODO make this configurable and expand its utility | ||
* // TODO make this configurable | ||
*/ | ||
@@ -110,0 +107,0 @@ private init; |
@@ -236,9 +236,6 @@ "use strict"; | ||
/** | ||
* Rendering mode switching routine; receives a State's rendering mode, indicating a transition towards either 2D or 3D rendering, and | ||
* configures WebGL to render in the mode if it's different than the last one | ||
* Extra WebGL state configuation for specific 2D and 3D related state | ||
* | ||
* Effectively allows a Game to comprise both 2D and 3D States | ||
* | ||
* @param mode the mode to switch to | ||
// */ | ||
* // TODO make this configurable | ||
*/ | ||
Renderer.prototype.setRenderingMode = function (mode) { | ||
@@ -249,2 +246,3 @@ var gl = this.gl; | ||
gl.depthFunc(gl.LESS); | ||
gl.enable(gl.CULL_FACE); | ||
} | ||
@@ -344,5 +342,5 @@ this.mode = mode; | ||
/** | ||
* Internal-use one-time WebGL configuration routine; set flags and enable features once at application initialisation | ||
* One-time WebGL global state configuration, where configurations apply to both 2D and 3D rendering modes | ||
* | ||
* // TODO make this configurable and expand its utility | ||
* // TODO make this configurable | ||
*/ | ||
@@ -349,0 +347,0 @@ Renderer.prototype.init = function () { |
Sorry, the diff of this file is too big to display
749954
383
15076