This commit is contained in:
Gregg Tavares 2020-01-15 03:36:23 +09:00
parent 0f76a17a0e
commit 3caa8a18d3
14 changed files with 95 additions and 18 deletions

View File

@ -75,6 +75,8 @@ export type AttachmentOptions = TextureOptions & {
export type FramebufferInfo = {
framebuffer: WebGLFramebuffer;
attachments: WebGLObject[];
width: number;
height: number;
};
export type ErrorCallback = (msg: string, lineOffset?: number) => void;
export type ProgramOptions = {

16
dist/4.x/twgl-full.js vendored
View File

@ -1,5 +1,5 @@
/*!
* @license twgl.js 4.14.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
* @license twgl.js 4.14.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
* Available via the MIT license.
* see: http://github.com/greggman/twgl.js for details
*/
@ -1252,6 +1252,8 @@ function isRenderbufferFormat(format) {
* @typedef {Object} FramebufferInfo
* @property {WebGLFramebuffer} framebuffer The WebGLFramebuffer for this framebufferInfo
* @property {WebGLObject[]} attachments The created attachments in the same order as passed in to {@link module:twgl.createFramebufferInfo}.
* @property {number} width The width of the framebuffer and its attachments
* @property {number} height The width of the framebuffer and its attachments
* @memberOf module:twgl
*/
@ -3672,7 +3674,17 @@ function createTruncatedConeVertices(bottomRadius, topRadius, height, radialSubd
var sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);
var cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);
positions.push(sin * ringRadius, y, cos * ringRadius);
normals.push(yy < 0 || yy > verticalSubdivisions ? 0 : sin * cosSlant, yy < 0 ? -1 : yy > verticalSubdivisions ? 1 : sinSlant, yy < 0 || yy > verticalSubdivisions ? 0 : cos * cosSlant);
if (yy < 0) {
normals.push(0, -1, 0);
} else if (yy > verticalSubdivisions) {
normals.push(0, 1, 0);
} else if (ringRadius === 0.0) {
normals.push(0, 0, 0);
} else {
normals.push(sin * cosSlant, sinSlant, cos * cosSlant);
}
texcoords.push(ii / radialSubdivisions, 1 - v);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/* @license twgl.js 4.14.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
/* @license twgl.js 4.14.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
Available via the MIT license.
see: http://github.com/greggman/twgl.js for details */
/*
@ -3510,10 +3510,15 @@ function createTruncatedConeVertices(
const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);
const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);
positions.push(sin * ringRadius, y, cos * ringRadius);
normals.push(
(yy < 0 || yy > verticalSubdivisions) ? 0 : (sin * cosSlant),
(yy < 0) ? -1 : (yy > verticalSubdivisions ? 1 : sinSlant),
(yy < 0 || yy > verticalSubdivisions) ? 0 : (cos * cosSlant));
if (yy < 0) {
normals.push(0, -1, 0);
} else if (yy > verticalSubdivisions) {
normals.push(0, 1, 0);
} else if (ringRadius === 0.0) {
normals.push(0, 0, 0);
} else {
normals.push(sin * cosSlant, sinSlant, cos * cosSlant);
}
texcoords.push((ii / radialSubdivisions), 1 - v);
}
}
@ -8741,6 +8746,8 @@ function isRenderbufferFormat(format) {
* @typedef {Object} FramebufferInfo
* @property {WebGLFramebuffer} framebuffer The WebGLFramebuffer for this framebufferInfo
* @property {WebGLObject[]} attachments The created attachments in the same order as passed in to {@link module:twgl.createFramebufferInfo}.
* @property {number} width The width of the framebuffer and its attachments
* @property {number} height The width of the framebuffer and its attachments
* @memberOf module:twgl
*/

2
dist/4.x/twgl.d.ts vendored
View File

@ -75,6 +75,8 @@ export type AttachmentOptions = TextureOptions & {
export type FramebufferInfo = {
framebuffer: WebGLFramebuffer;
attachments: WebGLObject[];
width: number;
height: number;
};
export type ErrorCallback = (msg: string, lineOffset?: number) => void;
export type ProgramOptions = {

4
dist/4.x/twgl.js vendored
View File

@ -1,5 +1,5 @@
/*!
* @license twgl.js 4.14.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
* @license twgl.js 4.14.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
* Available via the MIT license.
* see: http://github.com/greggman/twgl.js for details
*/
@ -1252,6 +1252,8 @@ function isRenderbufferFormat(format) {
* @typedef {Object} FramebufferInfo
* @property {WebGLFramebuffer} framebuffer The WebGLFramebuffer for this framebufferInfo
* @property {WebGLObject[]} attachments The created attachments in the same order as passed in to {@link module:twgl.createFramebufferInfo}.
* @property {number} width The width of the framebuffer and its attachments
* @property {number} height The width of the framebuffer and its attachments
* @memberOf module:twgl
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9534,6 +9534,56 @@ var drawObj = {
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last"><p>The width of the framebuffer and its attachments</p></td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last"><p>The width of the framebuffer and its attachments</p></td>
</tr>
</tbody>
</table>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<!-- this file is auto-generated from README.md. Do not edited directly -->
<!--
@license twgl.js 4.14.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
@license twgl.js 4.14.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
Available via the MIT license.
see: http://github.com/greggman/twgl.js for details
-->

View File

@ -1,5 +1,5 @@
/*!
* @license twgl.js 4.14.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
* @license twgl.js 4.14.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
* Available via the MIT license.
* see: http://github.com/greggman/twgl.js for details
*/
@ -1252,6 +1252,8 @@ function isRenderbufferFormat(format) {
* @typedef {Object} FramebufferInfo
* @property {WebGLFramebuffer} framebuffer The WebGLFramebuffer for this framebufferInfo
* @property {WebGLObject[]} attachments The created attachments in the same order as passed in to {@link module:twgl.createFramebufferInfo}.
* @property {number} width The width of the framebuffer and its attachments
* @property {number} height The width of the framebuffer and its attachments
* @memberOf module:twgl
*/

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "twgl-base.js",
"version": "4.14.1",
"version": "4.14.2",
"description": "A Tiny WebGL helper library",
"main": "dist/4.x/twgl.js",
"types": "dist/4.x/twgl-full.d.ts",