Skip to content

Commit

Permalink
Improve TypeDoc categories (#5977)
Browse files Browse the repository at this point in the history
  • Loading branch information
willeastcott committed Jan 24, 2024
1 parent 020e5f3 commit 56f4001
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/platform/graphics/graphics-device-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { NullGraphicsDevice } from './null/null-graphics-device.js';
*
* Defaults to 'default'.
* @returns {Promise} - Promise object representing the created graphics device.
* @category Graphics
*/
function createGraphicsDevice(canvas, options = {}) {

Expand Down
1 change: 1 addition & 0 deletions src/platform/input/touch-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @param {globalThis.Touch} touch - The browser Touch object.
* @returns {object} The coordinates of the touch relative to the touch.target DOM element. In the
* format \{x, y\}.
* @category Input
*/
function getTouchTargetCoords(touch) {
let totalOffsetX = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/scene/graphics/quad-render-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const _tempRect = new Vec4();
* pixels. Defaults to fullscreen (`0, 0, target.width, target.height`).
* @param {import('../../core/math/vec4.js').Vec4} [scissorRect] - The scissor rectangle of the
* quad, in pixels. Defaults to fullscreen (`0, 0, target.width, target.height`).
* @category Graphics
*/
function drawQuadWithShader(device, target, shader, rect, scissorRect) {

Expand Down Expand Up @@ -78,6 +79,7 @@ function drawQuadWithShader(device, target, shader, rect, scissorRect) {
* texture, in pixels. Defaults to fullscreen (`0, 0, target.width, target.height`).
* @param {import('../../core/math/vec4.js').Vec4} [scissorRect] - The scissor rectangle to use for
* the texture, in pixels. Defaults to fullscreen (`0, 0, target.width, target.height`).
* @category Graphics
*/
function drawTexture(device, texture, target, shader, rect, scissorRect) {
Debug.assert(!device.isWebGPU, 'pc.drawTexture is not currently supported on WebGPU platform.');
Expand Down
1 change: 1 addition & 0 deletions src/scene/graphics/reproject-texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ void main(void) {
* @param {import('../../core/math/vec4.js').Vec4} [options.rect] - Optional viewport rectangle.
* @param {number} [options.seamPixels] - Optional number of seam pixels to render
* @returns {boolean} True if the reprojection was applied and false otherwise (e.g. if rect is empty)
* @category Graphics
*/
function reprojectTexture(source, target, options = {}) {
// maintain backwards compatibility with previous function signature
Expand Down
10 changes: 10 additions & 0 deletions src/scene/procedural.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const shapePrimitives = [];
* uvs: uvs,
* indices: indices
* });
* @category Graphics
*/
function calculateNormals(positions, indices) {
const triangleCount = indices.length / 3;
Expand Down Expand Up @@ -103,6 +104,7 @@ function calculateNormals(positions, indices) {
* uvs: uvs,
* indices: indices
* });
* @category Graphics
*/
function calculateTangents(positions, normals, uvs, indices) {
// Lengyel's Method
Expand Down Expand Up @@ -238,6 +240,7 @@ function calculateTangents(positions, normals, uvs, indices) {
* uvs: [0, 0, 1, 0, 0, 1],
* indices: [0, 1, 2]
* });
* @category Graphics
*/
function createMesh(device, positions, opts) {

Expand Down Expand Up @@ -307,6 +310,7 @@ function createMesh(device, positions, opts) {
* (defaults to 30).
* @param {boolean} [opts.calculateTangents] - Generate tangent information (defaults to false).
* @returns {Mesh} A new torus-shaped mesh.
* @category Graphics
*/
function createTorus(device, opts = {}) {
// Check the supplied options and provide defaults for unspecified ones
Expand Down Expand Up @@ -605,6 +609,7 @@ function _createConeData(baseRadius, peakRadius, height, heightSegments, capSegm
* cylinder (defaults to 20).
* @param {boolean} [opts.calculateTangents] - Generate tangent information (defaults to false).
* @returns {Mesh} A new cylinder-shaped mesh.
* @category Graphics
*/
function createCylinder(device, opts = {}) {
// Check the supplied options and provide defaults for unspecified ones
Expand Down Expand Up @@ -647,6 +652,7 @@ function createCylinder(device, opts = {}) {
* (defaults to 20).
* @param {boolean} [opts.calculateTangents] - Generate tangent information (defaults to false).
* @returns {Mesh} A new cylinder-shaped mesh.
* @category Graphics
*/
function createCapsule(device, opts = {}) {
// Check the supplied options and provide defaults for unspecified ones
Expand Down Expand Up @@ -688,6 +694,7 @@ function createCapsule(device, opts = {}) {
* (defaults to 18).
* @param {boolean} [opts.calculateTangents] - Generate tangent information (defaults to false).
* @returns {Mesh} A new cone-shaped mesh.
* @category Graphics
*/
function createCone(device, opts = {}) {
// Check the supplied options and provide defaults for unspecified ones
Expand Down Expand Up @@ -727,6 +734,7 @@ function createCone(device, opts = {}) {
* the sphere (defaults to 16).
* @param {boolean} [opts.calculateTangents] - Generate tangent information (defaults to false).
* @returns {Mesh} A new sphere-shaped mesh.
* @category Graphics
*/
function createSphere(device, opts = {}) {
// Check the supplied options and provide defaults for unspecified ones
Expand Down Expand Up @@ -810,6 +818,7 @@ function createSphere(device, opts = {}) {
* (defaults to 5).
* @param {boolean} [opts.calculateTangents] - Generate tangent information (defaults to false).
* @returns {Mesh} A new plane-shaped mesh.
* @category Graphics
*/
function createPlane(device, opts = {}) {
// Check the supplied options and provide defaults for unspecified ones
Expand Down Expand Up @@ -895,6 +904,7 @@ function createPlane(device, opts = {}) {
* @param {number} [opts.yOffset] - Move the box vertically by given offset in local space. Pass
* 0.5 to generate the box with pivot point at the bottom face. Defaults to 0.
* @returns {Mesh} A new box-shaped mesh.
* @category Graphics
*/
function createBox(device, opts = {}) {
// Check the supplied options and provide defaults for unspecified ones
Expand Down
1 change: 1 addition & 0 deletions src/scene/shader-lib/chunks/chunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ import webgpuVS from '../../../platform/graphics/shader-chunks/vert/webgpu.js';
* Object containing all default shader chunks used by shader generators.
*
* @type {object}
* @category Graphics
*/
const shaderChunks = {
alphaTestPS,
Expand Down
1 change: 1 addition & 0 deletions src/scene/shader-lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function createShader(device, vsName, fsName, useTransformFeedback = false, shad
* attachments. Passing an array will set the output type for each color attachment.
* @see ShaderUtils.createDefinition
* @returns {Shader} The newly created shader.
* @category Graphics
*/
function createShaderFromCode(device, vsCode, fsCode, uniqueName, attributes, useTransformFeedback = false, shaderDefinitionOptions = {}) {

Expand Down

0 comments on commit 56f4001

Please sign in to comment.