sebastien 7 年 前
コミット
e0b34036a2

+ 32 - 1
src/Rendering/babylon.boundingBoxRenderer.ts

@@ -67,6 +67,11 @@
         configurable: true
     });
 
+    /**
+     * Component responsible of rendering the bounding box of the meshes in a scene.
+     * This is usually used through the mesh.showBoundingBox or the scene.forceShowBoundingBoxes properties
+     * 
+     */
     export class BoundingBoxRenderer implements ISceneComponent {
         /**
          * The component name helpfull to identify the component in the list of scene components.
@@ -78,15 +83,31 @@
          */
         public scene: Scene;
 
+        /**
+         * Color of the bounding box lines placed in front of an object
+         */
         public frontColor = new Color3(1, 1, 1);
+        /**
+         * Color of the bounding box lines placed behind an object
+         */
         public backColor = new Color3(0.1, 0.1, 0.1);
+        /**
+         * Defines if the renderer should show the back lines or not
+         */
         public showBackLines = true;
-        public renderList = new SmartArray<BoundingBox>(32);        
+        /**
+         * @hidden
+         */
+        public renderList = new SmartArray<BoundingBox>(32);
 
         private _colorShader: ShaderMaterial;
         private _vertexBuffers: { [key: string]: Nullable<VertexBuffer> } = {};
         private _indexBuffer: WebGLBuffer;
 
+        /**
+         * Instantiates a new bounding box renderer in a scene.
+         * @param scene the scene the  renderer renders in
+         */
         constructor(scene: Scene) {
             this.scene = scene;
             scene._addComponent(this);
@@ -158,6 +179,9 @@
             this._createIndexBuffer();
         }
 
+        /**
+         * @hidden
+         */
         public reset(): void {
             this.renderList.reset();
         }
@@ -222,6 +246,10 @@
             engine.setDepthWrite(true);
         }
 
+        /**
+         * In case of occlusion queries, we can render the occlusion bounding box through this method
+         * @param mesh Define the mesh to render the occlusion bounding box for
+         */
         public renderOcclusionBoundingBox(mesh: AbstractMesh): void {
 
             this._prepareRessources();
@@ -259,6 +287,9 @@
             engine.setColorWrite(true);
         }
 
+        /**
+         * Dispose and release the resources attached to this renderer.
+         */
         public dispose(): void {
             if (!this._colorShader) {
                 return;

+ 9 - 0
src/Rendering/babylon.edgesRenderer.ts

@@ -98,8 +98,17 @@
      * This class is used to generate edges of the mesh that could then easily be rendered in a scene.
      */
     export class EdgesRenderer implements IEdgesRenderer {
+
+        /**
+         * Define the size of the edges with an orthographic camera
+         */
         public edgesWidthScalerForOrthographic = 1000.0;
+
+        /**
+         * Define the size of the edges with a perspective camera
+         */
         public edgesWidthScalerForPerspective = 50.0;
+
         protected _source: AbstractMesh;
         protected _linesPositions = new Array<number>();
         protected _linesNormals = new Array<number>();