Skip to content

Commit

Permalink
Convert p5.Camera, fix p5 prototype methods with @for tag
Browse files Browse the repository at this point in the history
  • Loading branch information
davepagurek committed Feb 11, 2024
1 parent 1afc553 commit e0dd7ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
18 changes: 0 additions & 18 deletions src/webgl/p5.Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import p5 from '../core/main';
* If no parameters are given, the following default is used:
* camera(0, 0, (height/2) / tan(PI/6), 0, 0, 0, 0, 1, 0)
* @method camera
* @constructor
* @for p5
* @param {Number} [x] camera position value on x axis
* @param {Number} [y] camera position value on y axis
Expand Down Expand Up @@ -738,7 +737,6 @@ p5.Camera = class Camera {
* Accepts the same parameters as the global
* <a href="#/p5/perspective">perspective()</a>.
* More information on this function can be found there.
* @method perspective
* @for p5.Camera
* @example
* <div>
Expand Down Expand Up @@ -857,7 +855,6 @@ p5.Camera = class Camera {
* Accepts the same parameters as the global
* <a href="#/p5/ortho">ortho()</a>.
* More information on this function can be found there.
* @method ortho
* @for p5.Camera
* @example
* <div>
Expand Down Expand Up @@ -957,7 +954,6 @@ p5.Camera = class Camera {
* Accepts the same parameters as the global
* <a href="#/p5/frustum">frustum()</a>.
* More information on this function can be found there.
* @method frustum
* @for p5.Camera
* @example
* <div>
Expand Down Expand Up @@ -1057,7 +1053,6 @@ p5.Camera = class Camera {
/**
* Rotate camera view about arbitrary axis defined by x,y,z
* based on http://learnwebgl.brown37.net/07_cameras/camera_rotating_motion.html
* @method _rotateView
* @private
*/
_rotateView(a, x, y, z) {
Expand Down Expand Up @@ -1101,7 +1096,6 @@ p5.Camera = class Camera {

/**
* Panning rotates the camera view to the left and right.
* @method pan
* @param {Number} angle amount to rotate camera in current
* <a href="#/p5/angleMode">angleMode</a> units.
* Greater than 0 values rotate counterclockwise (to the left).
Expand Down Expand Up @@ -1159,7 +1153,6 @@ p5.Camera = class Camera {

/**
* Tilting rotates the camera view up and down.
* @method tilt
* @param {Number} angle amount to rotate camera in current
* <a href="#/p5/angleMode">angleMode</a> units.
* Greater than 0 values rotate counterclockwise (to the left).
Expand Down Expand Up @@ -1217,7 +1210,6 @@ p5.Camera = class Camera {

/**
* Reorients the camera to look at a position in world space.
* @method lookAt
* @for p5.Camera
* @param {Number} x x position of a point in world space
* @param {Number} y y position of a point in world space
Expand Down Expand Up @@ -1287,7 +1279,6 @@ p5.Camera = class Camera {
* Accepts the same parameters as the global
* <a href="#/p5/camera">camera()</a>.
* More information on this function can be found there.
* @method camera
* @for p5.Camera
* @example
* <div>
Expand Down Expand Up @@ -1448,7 +1439,6 @@ p5.Camera = class Camera {

/**
* Move camera along its local axes while maintaining current camera orientation.
* @method move
* @param {Number} x amount to move along camera's left-right axis
* @param {Number} y amount to move along camera's up-down axis
* @param {Number} z amount to move along camera's forward-backward axis
Expand Down Expand Up @@ -1521,7 +1511,6 @@ p5.Camera = class Camera {
/**
* Set camera position in world-space while maintaining current camera
* orientation.
* @method setPosition
* @param {Number} x x position of a point in world space
* @param {Number} y y position of a point in world space
* @param {Number} z z position of a point in world space
Expand Down Expand Up @@ -1585,7 +1574,6 @@ p5.Camera = class Camera {
* the target camera. If the target camera is active, it will be reflected
* on the screen.
*
* @method set
* @param {p5.Camera} cam source camera
*
* @example
Expand Down Expand Up @@ -1663,7 +1651,6 @@ p5.Camera = class Camera {
* interpolation is possible if the ratios of left, right, top and bottom are equal to each other.
* For example, when it is changed by orbitControl().
*
* @method slerp
* @param {p5.Camera} cam0 first p5.Camera
* @param {p5.Camera} cam1 second p5.Camera
* @param {Number} amt amount to use for interpolation during slerp
Expand Down Expand Up @@ -2005,7 +1992,6 @@ p5.Camera = class Camera {

/**
* Returns a copy of a camera.
* @method copy
* @private
*/
copy() {
Expand Down Expand Up @@ -2036,7 +2022,6 @@ p5.Camera = class Camera {
/**
* Returns a camera's local axes: left-right, up-down, and forward-backward,
* as defined by vectors in world-space.
* @method _getLocalAxes
* @private
*/
_getLocalAxes() {
Expand Down Expand Up @@ -2093,7 +2078,6 @@ p5.Camera = class Camera {

/**
* Orbits the camera about center point. For use with orbitControl().
* @method _orbit
* @private
* @param {Number} dTheta change in spherical coordinate theta
* @param {Number} dPhi change in spherical coordinate phi
Expand Down Expand Up @@ -2163,7 +2147,6 @@ p5.Camera = class Camera {
/**
* Orbits the camera about center point. For use with orbitControl().
* Unlike _orbit(), the direction of rotation always matches the direction of pointer movement.
* @method _orbitFree
* @private
* @param {Number} dx the x component of the rotation vector.
* @param {Number} dy the y component of the rotation vector.
Expand Down Expand Up @@ -2240,7 +2223,6 @@ p5.Camera = class Camera {

/**
* Returns true if camera is currently attached to renderer.
* @method _isActive
* @private
*/
_isActive() {
Expand Down
4 changes: 3 additions & 1 deletion utils/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ for (const key in submodules) {
}

function getModuleInfo(entry) {
const entryForTag = entry.tags.find(tag => tag.title === 'for');
const entryForTagValue = entryForTag && entryForTag.description;
const file = entry.context.file;
let { module, submodule, for: forEntry } = fileModuleInfo[file] || {};
forEntry = entry.memberof || forEntry;
forEntry = entry.memberof || entryForTagValue || forEntry;
return { module, submodule, forEntry };
}

Expand Down

0 comments on commit e0dd7ae

Please sign in to comment.