Skip to content

Commit

Permalink
Merge pull request #968 from x3dom/geoCacheParam
Browse files Browse the repository at this point in the history
add global useGeoCache param
  • Loading branch information
tsturm committed Jul 19, 2019
2 parents d3b277e + 70e2f88 commit 08ac69e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Main.js
Expand Up @@ -51,7 +51,8 @@ x3dom.userAgentFeature = {
'disableKeys',
'showTouchpoints',
'disableTouch',
'maxActiveDownloads'
'maxActiveDownloads',
'useGeoCache'
]);
var components, prefix;
var showLoggingConsole = false;
Expand All @@ -64,6 +65,7 @@ x3dom.userAgentFeature = {
settings.setProperty("showStat", x3ds[i].getAttribute("showStat") || 'false');
settings.setProperty("showProgress", x3ds[i].getAttribute("showProgress") || 'true');
settings.setProperty("PrimitiveQuality", x3ds[i].getAttribute("PrimitiveQuality") || 'High');
settings.setProperty("useGeoCache", x3ds[i].getAttribute("useGeoCache") || 'true');

// for each param element inside the X3D element
// add settings to properties object
Expand Down
7 changes: 5 additions & 2 deletions src/nodes/Rendering/X3DGeometryNode.js
Expand Up @@ -49,13 +49,16 @@ x3dom.registerNodeType(

/**
* Most geo primitives use geo cache and others might later on, but one should be able to disable cache per geometry node.
* Defaults to global useGeoCache setting parameter.
* @var {x3dom.fields.SFBool} useGeoCache
* @memberof x3dom.nodeTypes.X3DGeometryNode
* @initvalue true
* @field x3dom
* @instance
*/
this.addField_SFBool(ctx, 'useGeoCache', true);
this.addField_SFBool(ctx, 'useGeoCache', this._nameSpace ?
this._nameSpace.doc.properties.getProperty("useGeoCache", "true").toLowerCase() == 'true'
: false);

/**
* Specifies whether this geometry should be rendered with or without lighting.
Expand Down Expand Up @@ -125,4 +128,4 @@ x3dom.registerNodeType(
}
}
)
);
);

0 comments on commit 08ac69e

Please sign in to comment.