diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 23:56:24 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 23:56:24 +0000 |
commit | cd4740dba6b65213baa16dd31ede47731b092412 (patch) | |
tree | 5ddce879fcec2b47c0150bb6a411c751168780e4 | |
parent | 9b9f2e5d435484c6cb05c6a47604cbd0022455df (diff) | |
download | chromium_src-cd4740dba6b65213baa16dd31ede47731b092412.zip chromium_src-cd4740dba6b65213baa16dd31ede47731b092412.tar.gz chromium_src-cd4740dba6b65213baa16dd31ede47731b092412.tar.bz2 |
JSCompiler fixes
*) Generate goog.exportSymbol for all o3djs classes,
methods and properties so the JSCompiler does not
delete them
*) Remove goog.exportSymbol from the compiled result.
*) Remove o3djs.require from the compiled result.
*) Add docs to undocumented items in o3djs.
Review URL: http://codereview.chromium.org/155665
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20919 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | o3d/documentation/JSCompiler_deploy.jar | bin | 19582515 -> 0 bytes | |||
-rw-r--r-- | o3d/documentation/build.scons | 41 | ||||
-rwxr-xr-x | o3d/documentation/build_docs.py | 35 | ||||
-rw-r--r-- | o3d/documentation/jsdoc-toolkit-templates/publish.js | 45 | ||||
-rw-r--r-- | o3d/samples/o3djs/arcball.js | 47 | ||||
-rw-r--r-- | o3d/samples/o3djs/canvas.js | 71 | ||||
-rw-r--r-- | o3d/samples/o3djs/debug.js | 56 | ||||
-rw-r--r-- | o3d/samples/o3djs/util.js | 2 |
8 files changed, 225 insertions, 72 deletions
diff --git a/o3d/documentation/JSCompiler_deploy.jar b/o3d/documentation/JSCompiler_deploy.jar Binary files differdeleted file mode 100644 index 9f0b4f9..0000000 --- a/o3d/documentation/JSCompiler_deploy.jar +++ /dev/null diff --git a/o3d/documentation/build.scons b/o3d/documentation/build.scons index 1d68f9f..7bc998a 100644 --- a/o3d/documentation/build.scons +++ b/o3d/documentation/build.scons @@ -55,24 +55,23 @@ DOCSGEN_ARGS = ['$JSDOC_DIR/build_docs.py $JAVA_EXE'] env["BUILDERS"]["JSDocs"] = Builder(action=env.Python(DOCSGEN_ARGS)) -# index.ezt is a file that the jsdoctoolkit happens to build. -# Putting it in jsdocs means that will be our target dir for the rest -# of the files. -env.JSDocs('base.js', LOCAL_JS_SOURCES + LOCAL_IDL_SOURCES + - ['$JSDOC_EZT_TEMPLATE_DIR/annotated.tmpl', - '$JSDOC_EZT_TEMPLATE_DIR/class.tmpl', - '$JSDOC_EZT_TEMPLATE_DIR/classtree.tmpl', - '$JSDOC_EZT_TEMPLATE_DIR/filelist.tmpl', - '$JSDOC_EZT_TEMPLATE_DIR/members.tmpl', - '$JSDOC_EZT_TEMPLATE_DIR/namespaces.tmpl', - '$JSDOC_EZT_TEMPLATE_DIR/publish.js', - '$JSDOC_EZT_TEMPLATE_DIR/static/header.html', - '$JSDOC_EZT_TEMPLATE_DIR/static/footer.html', - '$JSDOC_EZT_TEMPLATE_DIR/static/stylesheet.css', - '$JSDOC_EZT_TEMPLATE_DIR/static/tabs.css', - '$JSDOC_EZT_TEMPLATE_DIR/static/tab_l.gif', - '$JSDOC_EZT_TEMPLATE_DIR/static/tab_r.gif', - '$JSDOC_EZT_TEMPLATE_DIR/static/tab_b.gif', - '$JSDOC_EXTERNS_DIR/externs.js', - '$JSDOC_EXTERNS_DIR/o3d-extra-externs.js', - '$JSDOC_DIR/build_docs.py']) +JSCOMP_PATH = "$SCONSTRUCT_DIR/../o3d-internal/jscomp/JSCompiler_deploy.jar" +if os.path.exists(env.subst(JSCOMP_PATH)): + env.JSDocs('base.js', LOCAL_JS_SOURCES + LOCAL_IDL_SOURCES + + ['$JSDOC_EZT_TEMPLATE_DIR/annotated.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/class.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/classtree.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/filelist.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/members.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/namespaces.tmpl', + '$JSDOC_EZT_TEMPLATE_DIR/publish.js', + '$JSDOC_EZT_TEMPLATE_DIR/static/header.html', + '$JSDOC_EZT_TEMPLATE_DIR/static/footer.html', + '$JSDOC_EZT_TEMPLATE_DIR/static/stylesheet.css', + '$JSDOC_EZT_TEMPLATE_DIR/static/tabs.css', + '$JSDOC_EZT_TEMPLATE_DIR/static/tab_l.gif', + '$JSDOC_EZT_TEMPLATE_DIR/static/tab_r.gif', + '$JSDOC_EZT_TEMPLATE_DIR/static/tab_b.gif', + '$JSDOC_EXTERNS_DIR/externs.js', + '$JSDOC_EXTERNS_DIR/o3d-extra-externs.js', + '$JSDOC_DIR/build_docs.py']) diff --git a/o3d/documentation/build_docs.py b/o3d/documentation/build_docs.py index d244524..dd995de 100755 --- a/o3d/documentation/build_docs.py +++ b/o3d/documentation/build_docs.py @@ -40,6 +40,7 @@ import types import glob
import subprocess
import shutil
+import re
_java_exe = ''
@@ -140,7 +141,7 @@ def RunNixysa(idl_files, generate, output_dir, nixysa_options): def RunJSDocToolkit(js_files, ezt_output_dir, html_output_dir, prefix, mode,
- baseURL, topURL):
+ baseURL, topURL, exports_file):
"""Executes the JSDocToolkit."""
list_filename = MakePath('../scons-out/docs/obj/doclist.conf')
f = open(list_filename, 'w')
@@ -150,6 +151,7 @@ def RunJSDocToolkit(js_files, ezt_output_dir, html_output_dir, prefix, mode, f.write('topURL: "%s",\n' % topURL)
f.write('mode: "%s",\n' % mode)
f.write('htmlOutDir: "%s",\n' % html_output_dir.replace('\\', '/'))
+ f.write('exportsFile: "%s",\n' % exports_file.replace('\\', '/'))
f.write('endMarker: ""\n')
f.write('},\n')
f.write('_: [\n')
@@ -170,6 +172,10 @@ def RunJSDocToolkit(js_files, ezt_output_dir, html_output_dir, prefix, mode, '-c=' + list_filename])
+def DeleteOldDocs(docs_js_outpath):
+ shutil.rmtree(docs_js_outpath);
+
+
def BuildJavaScriptForDocsFromIDLs(idl_files, output_dir):
RunNixysa(idl_files, 'jsheader', output_dir, ['--properties-equal-undefined'])
@@ -183,12 +189,12 @@ def BuildJavaScriptForExternsFromIDLs(idl_files, output_dir): def BuildO3DDocsFromJavaScript(js_files, ezt_output_dir, html_output_dir):
RunJSDocToolkit(js_files, ezt_output_dir, html_output_dir,
- 'classo3d_1_1_', 'o3d', '', '')
+ 'classo3d_1_1_', 'o3d', '', '', '')
-def BuildO3DJSDocs(js_files, ezt_output_dir, html_output_dir):
+def BuildO3DJSDocs(js_files, ezt_output_dir, html_output_dir, exports_file):
RunJSDocToolkit(js_files, ezt_output_dir, html_output_dir, 'js_0_1_', 'o3djs',
- 'jsdocs/', '../')
+ 'jsdocs/', '../', exports_file)
def BuildO3DExternsFile(js_files_dir, extra_externs_file, externs_file):
@@ -209,7 +215,7 @@ def BuildCompiledO3DJS(o3djs_files, Execute([
_java_exe,
'-jar',
- MakePath('JSCompiler_deploy.jar'),
+ MakePath('../../o3d-internal/jscomp/JSCompiler_deploy.jar'),
'--property_renaming', 'OFF',
'--variable_renaming', 'LOCAL',
'--remove_dead_assignments', 'false',
@@ -220,10 +226,11 @@ def BuildCompiledO3DJS(o3djs_files, #
'--collapse_variable_declarations', 'false',
'--disable_function_inline', 'true',
+ '--noextract_prototype_member_decl', 'true',
#'--disable_convert_to_dotted_properties', 'true',
#'--inline_functions', 'false',
# TODO(gman): Remove the flags below once the compiled js actually works.
- #'--pretty_print',
+ '--pretty_print',
#'--print_input_delimiter', 'true',
#'--strip_whitespace_and_comments_only', 'true',
##'--logging_level', '',
@@ -233,6 +240,16 @@ def BuildCompiledO3DJS(o3djs_files, ('--js_output_file=%s' % compiled_o3djs_outpath)] +
['-js=%s' % (x, ) for x in o3djs_files]);
+ # strip out goog.exportSymbol and o3djs.require stuff
+ file = open(compiled_o3djs_outpath, 'r')
+ contents = file.read()
+ file.close()
+ contents = re.sub(r'goog.exportSymbol\([^\)]*\);\n', '', contents)
+ contents = re.sub(r'o3djs.require\([^\)]*\);\n', '', contents)
+ file = open(compiled_o3djs_outpath, 'w')
+ file.write(contents)
+ file.close()
+
def CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath):
files = ['stylesheet.css',
@@ -268,6 +285,7 @@ def main(): o3djs_docs_ezt_outpath = MakePath(docs_outpath + 'reference/jsdocs')
o3djs_docs_html_outpath = MakePath(docs_outpath + 'local_html/jsdocs')
o3d_externs_path = MakePath(outpath + 'o3d-externs.js')
+ o3djs_exports_path = MakePath(outpath + 'o3d-exports.js')
compiled_o3djs_outpath = MakePath(docs_outpath + 'base.js')
externs_path = MakePath('externs/externs.js')
o3d_extra_externs_path = MakePath('externs/o3d-extra-externs.js')
@@ -288,6 +306,7 @@ def main(): os.path.splitext(os.path.basename(f))[0] + '.js')
for f in GlobalsDict['O3D_IDL_SOURCES']]
+ DeleteOldDocs(MakePath(docs_outpath))
BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath)
BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files,
o3d_docs_ezt_outpath, o3d_docs_html_outpath)
@@ -296,9 +315,9 @@ def main(): o3d_extra_externs_path,
o3d_externs_path)
BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath,
- o3djs_docs_html_outpath)
+ o3djs_docs_html_outpath, o3djs_exports_path)
CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath)
- BuildCompiledO3DJS(o3djs_files,
+ BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path],
externs_path,
o3d_externs_path,
compiled_o3djs_outpath)
diff --git a/o3d/documentation/jsdoc-toolkit-templates/publish.js b/o3d/documentation/jsdoc-toolkit-templates/publish.js index c588e5a..9070a1a 100644 --- a/o3d/documentation/jsdoc-toolkit-templates/publish.js +++ b/o3d/documentation/jsdoc-toolkit-templates/publish.js @@ -85,6 +85,7 @@ function publishInternal(symbolSet) { outDir: JSDOC.opt.d, templatesDir: JSDOC.opt.t, symbolsDir: '', + exportsFile: JSDOC.opt.D.exportsFile, prefix: JSDOC.opt.D.prefix, mode: JSDOC.opt.D.mode}; publish.conf.srcDir = publish.conf.outDir + 'src/'; @@ -93,6 +94,10 @@ function publishInternal(symbolSet) { g_topURL = JSDOC.opt.D.topURL; g_outputMode = JSDOC.opt.D.mode; + for (var key in publish.conf) { + print ("publish.conf." + key + ": " + publish.conf[key]) + } + if (publish.conf.mode == 'o3djs') { g_o3djsMode = true; } @@ -100,6 +105,9 @@ function publishInternal(symbolSet) { // In o3djs mode, don't generate docs for these. g_skipRE = new RegExp('^(o3d$|o3d\\.|Vectormath)'); + // Symbols we should always skip. + var alwaysSkipRE = new RegExp('^(_global_|VectorMath|Aos)'); + // is source output is suppressed, just display the links to the source file if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) { Link.prototype._makeSrcLink = function(srcFilePath) { @@ -124,7 +132,7 @@ function publishInternal(symbolSet) { try { var templatesDir = publish.conf.templatesDir; var classTemplate = new JSDOC.JsPlate(templatesDir + 'class.tmpl'); - //var exportsTemplate = new JSDOC.JsPlate(templatesDir + 'exports.tmpl'); + var exportsTemplate = new JSDOC.JsPlate(templatesDir + 'exports.tmpl'); var membersTemplate = new JSDOC.JsPlate(templatesDir + 'members.tmpl'); var classTreeTemplate = new JSDOC.JsPlate(templatesDir + 'classtree.tmpl'); var fileListTemplate = new JSDOC.JsPlate(templatesDir + 'filelist.tmpl'); @@ -164,6 +172,7 @@ function publishInternal(symbolSet) { // get a list of all the classes in the symbolset var classes = symbols.filter(isaClass).sort(makeSortby('alias')); var filteredClasses = []; + var exports = ''; // create each of the class pages for (var i = 0, l = classes.length; i < l; i++) { @@ -173,7 +182,8 @@ function publishInternal(symbolSet) { symbol.events = symbol.getEvents(); // 1 order matters symbol.methods = symbol.getMethods(); // 2 - if (g_o3djsMode && g_skipRE.test(symbol.alias)) { + if ((g_o3djsMode && g_skipRE.test(symbol.alias)) || + alwaysSkipRE.test(symbol.alias)) { print('Skipping docs for : ' + symbol.alias); continue; } @@ -214,6 +224,10 @@ function publishInternal(symbolSet) { (publish.conf.prefix + symbol.alias + '_members.html').toLowerCase(), output); + + if (publish.conf.exportsFile) { + exports += exportsTemplate.process(symbol); + } } var classTree = classTreeTemplate.process(filteredClasses); @@ -232,8 +246,16 @@ function publishInternal(symbolSet) { IO.saveFile(publish.conf.outDir, 'namespaces' + publish.conf.ext, namespaces); IO.saveFile(publish.conf.htmlDir, 'namespaces.html', namespaces); - //var exports = exportsTemplate.process(symbols); - //IO.saveFile(publish.conf.outDir, 'exports.js', fileList); + if (publish.conf.exportsFile) { + print("Writing exports: " + publish.conf.exportsFile); + var blankLineRE = /\n *\n/gm; + while (blankLineRE.test(exports)) { + exports = exports.replace(blankLineRE, '\n'); + } + var parts = publish.conf.exportsFile.replace('\\', '/'). + match(/(.*?)\/([^\/]+)$/); + IO.saveFile(parts[1], parts[2], exports); + } } /** @@ -912,6 +934,21 @@ function getDocName(parent, child) { } /** + * Gets a symbol name for export. If the method or property is static returns + * "Namespace.Class.method". If not returns "Namespace.Class.prototype.method". + * @param {!Symbol} symbol Symbol to get name for. + * @return {string} Name of symbol. + */ +function getSymbolNameForExport(symbol) { + if (!symbol.memberOf) { + return symbol.name; + } + return symbol.memberOf + + ((symbol.isStatic || symbol.isNamespace) ? '.' : '.prototype.') + + symbol.name; +} + +/** * Gets the base URL for links. */ function getBaseURL() { diff --git a/o3d/samples/o3djs/arcball.js b/o3d/samples/o3djs/arcball.js index 0f511ab..e37e92c 100644 --- a/o3d/samples/o3djs/arcball.js +++ b/o3d/samples/o3djs/arcball.js @@ -74,10 +74,33 @@ o3djs.arcball.create = function(areaWidth, areaHeight) { * @see o3djs.arcball */ o3djs.arcball.ArcBall = function(areaWidth, areaHeight) { - this.startVector = [0, 0, 0]; - this.endVector = [0, 0, 0]; - this.areaWidth = areaWidth; - this.areaHeight = areaHeight; + /** + * The start vector. + * @private + * @type {!o3djs.math.Vector3} + */ + this.startVector_ = [0, 0, 0]; + + /** + * The end vector. + * @private + * @type {!o3djs.math.Vector3} + */ + this.endVector_ = [0, 0, 0]; + + /** + * The width of the arcBall area. + * @private + * @type {number} + */ + this.areaWidth_ = areaWidth; + + /** + * The height of the arcBall area. + * @private + * @type {number} + */ + this.areaHeight_ = areaHeight; }; @@ -87,8 +110,8 @@ o3djs.arcball.ArcBall = function(areaWidth, areaHeight) { * @param {number} areaHeight height of area arcball should cover. */ o3djs.arcball.ArcBall.prototype.setAreaSize = function(areaWidth, areaHeight) { - this.areaWidth = areaWidth; - this.areaHeight = areaHeight; + this.areaWidth_ = areaWidth; + this.areaHeight_ = areaHeight; }; /** @@ -101,8 +124,8 @@ o3djs.arcball.ArcBall.prototype.mapToSphere = function(newPoint) { var tempPoint = o3djs.math.copyVector(newPoint); // Scale to -1.0 <-> 1.0 - tempPoint[0] = tempPoint[0] / this.areaWidth * 2.0 - 1.0; - tempPoint[1] = 1.0 - tempPoint[1] / this.areaHeight * 2.0; + tempPoint[0] = tempPoint[0] / this.areaWidth_ * 2.0 - 1.0; + tempPoint[1] = 1.0 - tempPoint[1] / this.areaHeight_ * 2.0; // Compute square of length from center var lengthSquared = o3djs.math.lengthSquared(tempPoint); @@ -121,7 +144,7 @@ o3djs.arcball.ArcBall.prototype.mapToSphere = function(newPoint) { * @param {!o3djs.math.Vector2} newPoint point in 2d. */ o3djs.arcball.ArcBall.prototype.click = function(newPoint) { - this.startVector = this.mapToSphere(newPoint); + this.startVector_ = this.mapToSphere(newPoint); }; /** @@ -132,8 +155,8 @@ o3djs.arcball.ArcBall.prototype.click = function(newPoint) { * orientation. */ o3djs.arcball.ArcBall.prototype.drag = function(newPoint) { - this.endVector = this.mapToSphere(newPoint); + this.endVector_ = this.mapToSphere(newPoint); - return o3djs.math.cross(this.startVector, this.endVector).concat( - o3djs.math.dot(this.startVector, this.endVector)); + return o3djs.math.cross(this.startVector_, this.endVector_).concat( + o3djs.math.dot(this.startVector_, this.endVector_)); }; diff --git a/o3d/samples/o3djs/canvas.js b/o3d/samples/o3djs/canvas.js index aa5070f..3c264b7 100644 --- a/o3d/samples/o3djs/canvas.js +++ b/o3d/samples/o3djs/canvas.js @@ -167,34 +167,47 @@ o3djs.canvas.CanvasInfo = function(pack, root, viewInfo) { */ this.root = root; - // Create the Effect object shared by all CanvasQuad instances. - this.effect = this.pack.createObject('Effect'); - this.effect.loadFromFXString(o3djs.canvas.FX_STRING); - - // Create two materials: One used for canvases with transparent content - // and one for opaque canvases. - this.transparentMaterial = this.pack.createObject('Material'); - this.opaqueMaterial = this.pack.createObject('Material'); - - this.transparentMaterial.effect = this.effect; - this.opaqueMaterial.effect = this.effect; - - this.transparentMaterial.drawList = viewInfo.zOrderedDrawList; - this.opaqueMaterial.drawList = viewInfo.performanceDrawList; - - // Create a state object to handle the transparency blending mode - // for transparent canvas quads. - // The canvas bitmap already multiplies the color values by alpha. In order - // to avoid a black halo around text drawn on a transparent background we - // need to set the blending mode as follows. - this.transparentState = this.pack.createObject('State'); - this.transparentState.getStateParam('AlphaBlendEnable').value = true; - this.transparentState.getStateParam('SourceBlendFunction').value = + /** + * The Effect object shared by all CanvasQuad instances. + * @type {!o3d.Effect} + */ + this.effect_ = this.pack.createObject('Effect'); + this.effect_.loadFromFXString(o3djs.canvas.FX_STRING); + + /** + * Material for canvases with transparent content + * @type {!o3d.Material} + */ + this.transparentMaterial_ = this.pack.createObject('Material'); + + /** + * Material for canvases with opaque content. + * @type {!o3d.Material} + */ + this.opaqueMaterial_ = this.pack.createObject('Material'); + + this.transparentMaterial_.effect = this.effect_; + this.opaqueMaterial_.effect = this.effect_; + + this.transparentMaterial_.drawList = viewInfo.zOrderedDrawList; + this.opaqueMaterial_.drawList = viewInfo.performanceDrawList; + + /** + * State object to handle the transparency blending mode + * for transparent canvas quads. + * The canvas bitmap already multiplies the color values by alpha. In order + * to avoid a black halo around text drawn on a transparent background we + * need to set the blending mode as follows. + * @type {!o3d.State} + */ + this.transparentState_ = this.pack.createObject('State'); + this.transparentState_.getStateParam('AlphaBlendEnable').value = true; + this.transparentState_.getStateParam('SourceBlendFunction').value = o3djs.base.o3d.State.BLENDFUNC_ONE; - this.transparentState.getStateParam('DestinationBlendFunction').value = + this.transparentState_.getStateParam('DestinationBlendFunction').value = o3djs.base.o3d.State.BLENDFUNC_INVERSE_SOURCE_ALPHA; - this.transparentMaterial.state = this.transparentState; + this.transparentMaterial_.state = this.transparentState_; // Create 2d plane shapes. createPlane makes an XZ plane by default // so we pass in matrix to rotate it to an XY plane. We could do @@ -206,7 +219,7 @@ o3djs.canvas.CanvasInfo = function(pack, root, viewInfo) { */ this.transparentQuadShape = o3djs.primitives.createPlane( this.pack, - this.transparentMaterial, + this.transparentMaterial_, 1, 1, 1, @@ -222,7 +235,7 @@ o3djs.canvas.CanvasInfo = function(pack, root, viewInfo) { */ this.opaqueQuadShape = o3djs.primitives.createPlane( this.pack, - this.opaqueMaterial, + this.opaqueMaterial_, 1, 1, 1, @@ -261,6 +274,10 @@ o3djs.canvas.CanvasQuad = function(canvasInfo, height, transparent, opt_parent) { + /** + * The CanvasInfo managing this CanvasQuad + * @type {!o3djs.canvas.CanvasInfo} + */ this.canvasInfo = canvasInfo; var parentTransform = opt_parent || canvasInfo.root; diff --git a/o3d/samples/o3djs/debug.js b/o3d/samples/o3djs/debug.js index 8b1dc8d..9589c50 100644 --- a/o3d/samples/o3djs/debug.js +++ b/o3d/samples/o3djs/debug.js @@ -223,7 +223,16 @@ o3djs.debug.createLineShape = function(pack, * @param {!Array.<number>} opt_indices array of indices in pairs. */ o3djs.debug.VertexInfo = function(opt_vertices, opt_indices) { + /** + * The vertices for this VertexInfo. + * @type {!Array.<o3djs.math.Vector3>} + */ this.vertices = opt_vertices || []; + + /** + * The vertex indices this VertexInfo. + * @type {!Array.<number>} + */ this.indices = opt_indices || []; }; @@ -490,8 +499,26 @@ o3djs.debug.DebugLine = function(debugLineGroup) { this.transform_ = pack.createObject('Transform'); this.transform_.name = O3D_DEBUG_LINE_SHAPE_NAME; this.transform_.addShape(debugLineGroup.getLineShape()); + + /** + * The start position of the line. + * @private + * @type {!o3djs.math.Vector3} + */ this.start_ = [0, 0, 0]; + + /** + * The start position of the line. + * @private + * @type {!o3djs.math.Vector3} + */ this.end_ = [0, 0, 0]; + + /** + * The color param for the line. + * @private + * @type {!o3d.ParamFloat4} + */ this.colorParam_ = this.transform_.createParam( O3D_DEBUG_COLOR_PARAM_NAME, 'ParamFloat4'); this.colorParam_.value = debugLineGroup.getColor(); @@ -599,10 +626,39 @@ o3djs.debug.DebugLine.prototype.remove = function() { * @param {!o3d.Transform} root Transform to put debug lines under. */ o3djs.debug.DebugLineGroup = function(debugHelper, root) { + /** + * The default color to make new lines. + * @private + * @type {!o3djs.math.Vector4} + */ this.currentColor_ = [1, 1, 1, 1]; + + /** + * The transforms for all the lines in this group indexed by clientId. + * @private + * @type {!Object.<number, !o3d.Transform>} + */ this.lineTransforms_ = { }; + + /** + * The transforms for all the unused lines in this group indexed by clientId. + * @private + * @type {!Object.<number, !o3d.Transform>} + */ this.freeLineTransforms_ = { }; + + /** + * The DebugHelper managing this DebugLineGroup. + * @private + * @type {!o3djs.debug.DebugHelper} + */ this.debugHelper_ = debugHelper; + + /** + * The root transform for lines in this group. + * @private + * @type {!o3d.Transform} + */ this.root_ = root; }; diff --git a/o3d/samples/o3djs/util.js b/o3d/samples/o3djs/util.js index 563c696..c5cd6e1 100644 --- a/o3d/samples/o3djs/util.js +++ b/o3d/samples/o3djs/util.js @@ -632,6 +632,7 @@ o3djs.util.toAbsoluteUri = function(uri) { /** * The script URIs. + * @private * @type {!Array.<string>} */ o3djs.util.scriptUris_ = []; @@ -669,6 +670,7 @@ o3djs.util.isScriptUri = function(uri) { * Concatenate the text of all the script tags in the document and invokes * the callback when complete. This function is asynchronous if any of the * script tags reference JavaScript through a URI. + * @private * @return {string} The script tag text. */ o3djs.util.getScriptTagText_ = function() { |