Просмотр исходного кода

Docs: Improve formatting. (#30542)

* Docs: Improve formatting.

* Docs: Add missing methods.
Michael Herzog 1 год назад
Родитель
Сommit
cddc105801

+ 23 - 0
src/core/Object3D.js

@@ -58,6 +58,7 @@ class Object3D extends EventDispatcher {
 		/**
 		 * The ID of the 3D object.
 		 *
+		 * @name Object3D#id
 		 * @type {number}
 		 * @readonly
 		 */
@@ -977,6 +978,13 @@ class Object3D extends EventDispatcher {
 	 */
 	raycast( /* raycaster, intersects */ ) {}
 
+	/**
+	 * Executes the callback on this 3D object and all descendants.
+	 *
+	 * Note: Modifying the scene graph inside the callback is discouraged.
+	 *
+	 * @param {Function} callback - A callback function that allows to process the current 3D object.
+	 */
 	traverse( callback ) {
 
 		callback( this );
@@ -991,6 +999,14 @@ class Object3D extends EventDispatcher {
 
 	}
 
+	/**
+	 * Like {@link Object3D#traverse}, but the callback will only be executed for visible 3D objects.
+	 * Descendants of invisible 3D objects are not traversed.
+	 *
+	 * Note: Modifying the scene graph inside the callback is discouraged.
+	 *
+	 * @param {Function} callback - A callback function that allows to process the current 3D object.
+	 */
 	traverseVisible( callback ) {
 
 		if ( this.visible === false ) return;
@@ -1007,6 +1023,13 @@ class Object3D extends EventDispatcher {
 
 	}
 
+	/**
+	 * Like {@link Object3D#traverse}, but the callback will only be executed for all ancestors.
+	 *
+	 * Note: Modifying the scene graph inside the callback is discouraged.
+	 *
+	 * @param {Function} callback - A callback function that allows to process the current 3D object.
+	 */
 	traverseAncestors( callback ) {
 
 		const parent = this.parent;

+ 8 - 0
utils/docs/template/static/styles/page.css

@@ -163,6 +163,10 @@ h3 {
 		padding-left: 64px;
 	}
 
+	ol.linenums .selected {
+		background-color: #ddd;
+	}
+
 	code {
 		display: inline-block;
 		vertical-align: middle;
@@ -214,6 +218,10 @@ h3 {
 		.link-anchor {
 			color: #555;
 		}
+
+		ol.linenums .selected {
+			background-color: #444;
+		}
 	
 	}
 

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

@@ -7,7 +7,7 @@ pre .pun, code .pun { color: #888888; } /* punctuation */
 pre .pln, code .pln { color: #444444; } /* plaintext */
 pre .dec, code .dec { color: #22c0c4; } /* decimal */
 
-pre, code {
+pre {
 	background-color: #F5F5F5;
 	font-family: 'Roboto Mono', monospace;
 }
@@ -22,7 +22,7 @@ pre, code {
 	pre .lit, code .lit { color: #ff3399; } /* literal */
 	pre .pln, code .pln { color: #aaaaaa; } /* plaintext */
 
-	pre, code {
+	pre {
 		background-color: #333333;
 	}
 

粤ICP备19079148号