Skip to content

Commit cddc105

Browse files
authored
Docs: Improve formatting. (#30542)
* Docs: Improve formatting. * Docs: Add missing methods.
1 parent 11c1261 commit cddc105

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

src/core/Object3D.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class Object3D extends EventDispatcher {
5858
/**
5959
* The ID of the 3D object.
6060
*
61+
* @name Object3D#id
6162
* @type {number}
6263
* @readonly
6364
*/
@@ -977,6 +978,13 @@ class Object3D extends EventDispatcher {
977978
*/
978979
raycast( /* raycaster, intersects */ ) {}
979980

981+
/**
982+
* Executes the callback on this 3D object and all descendants.
983+
*
984+
* Note: Modifying the scene graph inside the callback is discouraged.
985+
*
986+
* @param {Function} callback - A callback function that allows to process the current 3D object.
987+
*/
980988
traverse( callback ) {
981989

982990
callback( this );
@@ -991,6 +999,14 @@ class Object3D extends EventDispatcher {
991999

9921000
}
9931001

1002+
/**
1003+
* Like {@link Object3D#traverse}, but the callback will only be executed for visible 3D objects.
1004+
* Descendants of invisible 3D objects are not traversed.
1005+
*
1006+
* Note: Modifying the scene graph inside the callback is discouraged.
1007+
*
1008+
* @param {Function} callback - A callback function that allows to process the current 3D object.
1009+
*/
9941010
traverseVisible( callback ) {
9951011

9961012
if ( this.visible === false ) return;
@@ -1007,6 +1023,13 @@ class Object3D extends EventDispatcher {
10071023

10081024
}
10091025

1026+
/**
1027+
* Like {@link Object3D#traverse}, but the callback will only be executed for all ancestors.
1028+
*
1029+
* Note: Modifying the scene graph inside the callback is discouraged.
1030+
*
1031+
* @param {Function} callback - A callback function that allows to process the current 3D object.
1032+
*/
10101033
traverseAncestors( callback ) {
10111034

10121035
const parent = this.parent;

utils/docs/template/static/styles/page.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ h3 {
163163
padding-left: 64px;
164164
}
165165

166+
ol.linenums .selected {
167+
background-color: #ddd;
168+
}
169+
166170
code {
167171
display: inline-block;
168172
vertical-align: middle;
@@ -214,6 +218,10 @@ h3 {
214218
.link-anchor {
215219
color: #555;
216220
}
221+
222+
ol.linenums .selected {
223+
background-color: #444;
224+
}
217225

218226
}
219227

utils/docs/template/static/styles/prettify-three.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pre .pun, code .pun { color: #888888; } /* punctuation */
77
pre .pln, code .pln { color: #444444; } /* plaintext */
88
pre .dec, code .dec { color: #22c0c4; } /* decimal */
99

10-
pre, code {
10+
pre {
1111
background-color: #F5F5F5;
1212
font-family: 'Roboto Mono', monospace;
1313
}
@@ -22,7 +22,7 @@ pre, code {
2222
pre .lit, code .lit { color: #ff3399; } /* literal */
2323
pre .pln, code .pln { color: #aaaaaa; } /* plaintext */
2424

25-
pre, code {
25+
pre {
2626
background-color: #333333;
2727
}
2828

0 commit comments

Comments
 (0)