Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSDoc for getters #6685

Merged
merged 13 commits into from
Jun 11, 2024
9 changes: 7 additions & 2 deletions src/core/math/curve-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CurveSet {
}

/**
* The number of curves in the curve set.
* Gets the number of curves in the curve set.
*
* @type {number}
*/
Expand All @@ -70,7 +70,7 @@ class CurveSet {
}

/**
* The interpolation scheme applied to all curves in the curve set. Can be:
* Sets the interpolation scheme applied to all curves in the curve set. Can be:
*
* - {@link CURVE_LINEAR}
* - {@link CURVE_SMOOTHSTEP}
Expand All @@ -88,6 +88,11 @@ class CurveSet {
}
}

/**
* Gets the interpolation scheme applied to all curves in the curve set.
*
* @type {number}
*/
get type() {
return this._type;
}
Expand Down
7 changes: 6 additions & 1 deletion src/core/shape/oriented-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class OrientedBox {
}

/**
* The world transform of the OBB.
* Sets the world transform of the OBB.
*
* @type {Mat4}
*/
Expand All @@ -66,6 +66,11 @@ class OrientedBox {
this._modelTransform.copy(value).invert();
}

/**
* Gets the world transform of the OBB.
*
* @type {Mat4}
*/
get worldTransform() {
return this._worldTransform;
}
Expand Down
14 changes: 12 additions & 2 deletions src/extras/gizmo/gizmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class Gizmo extends EventHandler {
}

/**
* The gizmo coordinate space. Can be:
* Sets the gizmo coordinate space. Can be:
*
* - {@link GIZMO_LOCAL}
* - {@link GIZMO_WORLD}
Expand All @@ -313,12 +313,17 @@ class Gizmo extends EventHandler {
this._updateRotation();
}

/**
* Gets the gizmo coordinate space.
*
* @type {string}
*/
get coordSpace() {
return this._coordSpace;
}

/**
* The gizmo size. Defaults to 1.
* Sets the gizmo size. Defaults to 1.
*
* @type {number}
*/
Expand All @@ -327,6 +332,11 @@ class Gizmo extends EventHandler {
this._updateScale();
}

/**
* Gets the gizmo size.
*
* @type {number}
*/
get size() {
return this._size;
}
Expand Down
35 changes: 30 additions & 5 deletions src/extras/gizmo/rotate-gizmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,59 +174,79 @@ class RotateGizmo extends TransformGizmo {
}

/**
* XYZ tube radius.
* Sets the XYZ tube radius.
*
* @type {number}
*/
set xyzTubeRadius(value) {
this._setDiskProp('tubeRadius', value);
}

/**
* Gets the XYZ tube radius.
*
* @type {number}
*/
get xyzTubeRadius() {
return this._shapes.x.tubeRadius;
}

/**
* XYZ ring radius.
* Sets the XYZ ring radius.
*
* @type {number}
*/
set xyzRingRadius(value) {
this._setDiskProp('ringRadius', value);
}

/**
* Gets the XYZ ring radius.
*
* @type {number}
*/
get xyzRingRadius() {
return this._shapes.x.ringRadius;
}

/**
* Face tube radius.
* Sets the face tube radius.
*
* @type {number}
*/
set faceTubeRadius(value) {
this._shapes.face.tubeRadius = value;
}

/**
* Gets the face tube radius.
*
* @type {number}
*/
get faceTubeRadius() {
return this._shapes.face.tubeRadius;
}

/**
* Face ring radius.
* Sets the face ring radius.
*
* @type {number}
*/
set faceRingRadius(value) {
this._shapes.face.ringRadius = value;
}

/**
* Gets the face ring radius.
*
* @type {number}
*/
get faceRingRadius() {
return this._shapes.face.ringRadius;
}

/**
* Ring tolerance.
* Sets the ring tolerance.
*
* @type {number}
*/
Expand All @@ -235,6 +255,11 @@ class RotateGizmo extends TransformGizmo {
this._shapes.face.tolerance = value;
}

/**
* Gets the ring tolerance.
*
* @type {number}
*/
get ringTolerance() {
return this._shapes.x.tolerance;
}
Expand Down
70 changes: 60 additions & 10 deletions src/extras/gizmo/scale-gizmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,131 +136,181 @@ class ScaleGizmo extends TransformGizmo {
}

/**
* Uniform scaling state for planes.
* Sets the uniform scaling state for planes.
*
* @type {boolean}
*/
set uniform(value) {
this._useUniformScaling = value ?? true;
}

/**
* Gets the uniform scaling state for planes.
*
* @type {boolean}
*/
get uniform() {
return this._useUniformScaling;
}

/**
* Axis gap.
* Sets the axis gap.
*
* @type {number}
*/
set axisGap(value) {
this._setArrowProp('gap', value);
}

/**
* Gets the axis gap.
*
* @type {number}
*/
get axisGap() {
return this._shapes.x.gap;
}

/**
* Axis line thickness.
* Sets the axis line thickness.
*
* @type {number}
*/
set axisLineThickness(value) {
this._setArrowProp('lineThickness', value);
}

/**
* Gets the axis line thickness.
*
* @type {number}
*/
get axisLineThickness() {
return this._shapes.x.lineThickness;
}

/**
* Axis line length.
* Sets the axis line length.
*
* @type {number}
*/
set axisLineLength(value) {
this._setArrowProp('lineLength', value);
}

/**
* Gets the axis line length.
*
* @type {number}
*/
get axisLineLength() {
return this._shapes.x.lineLength;
}

/**
* Axis line tolerance.
* Sets the axis line tolerance.
*
* @type {number}
*/
set axisLineTolerance(value) {
this._setArrowProp('tolerance', value);
}

/**
* Gets the axis line tolerance.
*
* @type {number}
*/
get axisLineTolerance() {
return this._shapes.x.tolerance;
}

/**
* Axis box size.
* Sets the axis box size.
*
* @type {number}
*/
set axisBoxSize(value) {
this._setArrowProp('boxSize', value);
}

/**
* Gets the axis box size.
*
* @type {number}
*/
get axisBoxSize() {
return this._shapes.x.boxSize;
}

/**
* Plane size.
* Sets the plane size.
*
* @type {number}
*/
set axisPlaneSize(value) {
this._setPlaneProp('size', value);
}

/**
* Gets the plane size.
*
* @type {number}
*/
get axisPlaneSize() {
return this._shapes.yz.size;
}

/**
* Plane gap.
* Sets the plane gap.
*
* @type {number}
*/
set axisPlaneGap(value) {
this._setPlaneProp('gap', value);
}

/**
* Gets the plane gap.
*
* @type {number}
*/
get axisPlaneGap() {
return this._shapes.yz.gap;
}

/**
* Axis center size.
* Sets the axis center size.
*
* @type {number}
*/
set axisCenterSize(value) {
this._shapes.xyz.size = value;
}

/**
* Gets the axis center size.
*
* @type {number}
*/
get axisCenterSize() {
return this._shapes.xyz.size;
}

/**
* Axis center tolerance.
* Sets the axis center tolerance.
*
* @type {number}
*/
set axisCenterTolerance(value) {
this._shapes.xyz.tolerance = value;
}

/**
* Gets the axis center tolerance.
*
* @type {number}
*/
get axisCenterTolerance() {
return this._shapes.xyz.tolerance;
}
Expand Down
Loading