Skip to content
Browse files

Merge branch 'master' of https://github.com/x3dom/x3dom

  • Loading branch information...
2 parents ef80200 + 55210cb commit aefcbed2bc66efde588992f85a4bbbf028334204 mlimper committed Aug 31, 2012
Showing with 91 additions and 146 deletions.
  1. +27 −15 src/Viewarea.js
  2. +32 −113 src/X3DCanvas.js
  3. +13 −7 src/gfx_webgl.js
  4. +3 −10 src/nodes/EnvironmentalEffects.js
  5. +16 −1 src/nodes/Grouping.js
View
42 src/Viewarea.js
@@ -488,12 +488,10 @@ x3dom.Viewarea.prototype.getLightsShadow = function () {
}
};
-x3dom.Viewarea.prototype.getViewpointMatrix = function () {
+x3dom.Viewarea.prototype.updateSpecialNavigation = function (viewpoint, mat_viewpoint) {
var navi = this._scene.getNavigationInfo();
- var viewpoint = this._scene.getViewpoint();
- var mat_viewpoint = viewpoint.getCurrentTransform();
-
- // helicopter mode needs to manipulate view matrix
+
+ // helicopter mode needs to manipulate view matrix specially
if (navi._vf.type[0].toLowerCase() == "helicopter" && !navi._heliUpdated)
{
var typeParams = navi.getTypeParams();
@@ -524,9 +522,14 @@ x3dom.Viewarea.prototype.getViewpointMatrix = function () {
navi._heliUpdated = true;
}
- // end of special helicopter handling
+};
- //return mat_viewpoint.mult(viewpoint.getViewMatrix());
+x3dom.Viewarea.prototype.getViewpointMatrix = function () {
+ var viewpoint = this._scene.getViewpoint();
+ var mat_viewpoint = viewpoint.getCurrentTransform();
+
+ this.updateSpecialNavigation(viewpoint, mat_viewpoint);
+
return viewpoint.getViewMatrix().mult(mat_viewpoint.inverse());
};
@@ -1052,7 +1055,7 @@ x3dom.Viewarea.prototype.onMoveView = function (translation, rotation)
{
var distance = 10;
- if (this._scene._lastMin !== undefined && this._scene._lastMax !== undefined)
+ if (this._scene._lastMin && this._scene._lastMax)
{
distance = (this._scene._lastMax.subtract(this._scene._lastMin)).length();
distance = (distance < x3dom.fields.Eps) ? 1 : distance;
@@ -1121,7 +1124,7 @@ x3dom.Viewarea.prototype.onDrag = function (x, y, buttonState)
}
if (buttonState & 4) //middle
{
- if (this._scene._lastMin !== undefined && this._scene._lastMax !== undefined)
+ if (this._scene._lastMin && this._scene._lastMax)
{
d = (this._scene._lastMax.subtract(this._scene._lastMin)).length();
d = (d < x3dom.fields.Eps) ? 1 : d;
@@ -1130,15 +1133,20 @@ x3dom.Viewarea.prototype.onDrag = function (x, y, buttonState)
{
min = x3dom.fields.SFVec3f.MAX();
max = x3dom.fields.SFVec3f.MIN();
- ok = this._scene.getVolume(min, max, false);
+
+ ok = this._scene.getVolume(min, max, true);
+ if (ok) {
+ this._scene._lastMin = min;
+ this._scene._lastMax = max;
+ }
d = ok ? (max.subtract(min)).length() : 10;
d = (d < x3dom.fields.Eps) ? 1 : d;
}
//x3dom.debug.logInfo("PAN: " + min + " / " + max + " D=" + d);
//x3dom.debug.logInfo("w="+this._width+", h="+this._height);
- vec = new x3dom.fields.SFVec3f(d*dx/this._width,d*(-dy)/this._height,0);
+ vec = new x3dom.fields.SFVec3f(d*dx/this._width, d*(-dy)/this._height, 0);
this._movement = this._movement.add(vec);
//TODO; move real distance along viewing plane
@@ -1148,7 +1156,7 @@ x3dom.Viewarea.prototype.onDrag = function (x, y, buttonState)
}
if (buttonState & 2) //right
{
- if (this._scene._lastMin !== undefined && this._scene._lastMax !== undefined)
+ if (this._scene._lastMin && this._scene._lastMax)
{
d = (this._scene._lastMax.subtract(this._scene._lastMin)).length();
d = (d < x3dom.fields.Eps) ? 1 : d;
@@ -1157,15 +1165,20 @@ x3dom.Viewarea.prototype.onDrag = function (x, y, buttonState)
{
min = x3dom.fields.SFVec3f.MAX();
max = x3dom.fields.SFVec3f.MIN();
- ok = this._scene.getVolume(min, max, false);
+
+ ok = this._scene.getVolume(min, max, true);
+ if (ok) {
+ this._scene._lastMin = min;
+ this._scene._lastMax = max;
+ }
d = ok ? (max.subtract(min)).length() : 10;
d = (d < x3dom.fields.Eps) ? 1 : d;
}
//x3dom.debug.logInfo("ZOOM: " + min + " / " + max + " D=" + d);
//x3dom.debug.logInfo((dx+dy)+" w="+this._width+", h="+this._height);
- vec = new x3dom.fields.SFVec3f(0,0,d*(dx+dy)/this._height);
+ vec = new x3dom.fields.SFVec3f(0, 0, d*(dx+dy)/this._height);
this._movement = this._movement.add(vec);
//TODO; move real distance along viewing ray
@@ -1182,7 +1195,6 @@ x3dom.Viewarea.prototype.onDrag = function (x, y, buttonState)
this._lastY = y;
};
-
x3dom.Viewarea.prototype.prepareEvents = function (x, y, buttonState, eventType)
{
var avoidTraversal = (this._scene._vf.pickMode.toLowerCase() === "idbuf" ||
View
145 src/X3DCanvas.js
@@ -17,9 +17,10 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
var that = this;
this.canvasIdx = canvasIdx;
- this.initContext = function(canvas) {
+
+ this.initContext = function(canvas, forbidMobileShaders) {
x3dom.debug.logInfo("Initializing X3DCanvas for [" + canvas.id + "]");
- var gl = x3dom.gfx_webgl(canvas);
+ var gl = x3dom.gfx_webgl(canvas, forbidMobileShaders);
if (!gl) {
x3dom.debug.logError("No 3D context found...");
this.x3dElem.removeChild(canvas);
@@ -278,8 +279,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
}
// Apply the width and height of the X3D element to the canvas
- var w = 2;
- var h = 2;
+ var w = 2, h = 2;
if ((w = x3dElem.getAttribute("width")) !== null) {
//Attention: pbuffer dim is _not_ derived from style attribs!
@@ -309,8 +309,6 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
];
if ((_old_dim[0] != new_dim[0]) || (_old_dim[1] != new_dim[1])) {
- //x3dom.debug.logInfo("Resize detected w/h: " +
- // _old_dim[0] + "/" + _old_dim[1] + " => " + new_dim[0] + "/" + new_dim[1]);
_old_dim = new_dim;
that.x3dElem.setAttribute("width", new_dim[0]);
that.x3dElem.setAttribute("height", new_dim[1]);
@@ -362,29 +360,33 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.x3dElem = x3dElem;
- this.backend = 'none';
+ this.backend = this.x3dElem.getAttribute('backend');
+ if (this.backend)
+ this.backend = this.backend.toLowerCase()
+ else
+ this.backend = 'none';
- if(this.x3dElem.getAttribute('backend') == 'flash') {
+ if (this.backend == 'flash') {
this.backend = 'flash';
this.canvas = this.createFlashObject(x3dElem);
- if(this.canvas != null) {
+ if (this.canvas != null) {
this.canvas.parent = this;
this.gl = this.initFlashContext(this.canvas);
} else {
this.createInitFailedDiv(x3dElem);
return null;
}
- }else{
- this.backend = 'webgl';
+ } else {
this.canvas = this.createHTMLCanvas(x3dElem);
this.canvas.parent = this;
- this.gl = this.initContext(this.canvas);
- if(this.gl == null)
+ this.gl = this.initContext(this.canvas, (this.backend.search("desktop") >= 0));
+ this.backend = 'webgl';
+ if (this.gl == null)
{
x3dom.debug.logInfo("Fallback to Flash Renderer");
this.backend = 'flash';
this.canvas = this.createFlashObject(x3dElem);
- if(this.canvas != null) {
+ if (this.canvas != null) {
this.canvas.parent = this;
this.gl = this.initFlashContext(this.canvas);
} else {
@@ -402,7 +404,6 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
// allow listening for (size) changes
x3dElem.__setAttribute = x3dElem.setAttribute;
x3dElem.setAttribute = function(attrName, newVal) {
- //var prevVal = this.getAttribute(attrName);
this.__setAttribute(attrName, newVal);
switch(attrName) {
@@ -411,15 +412,13 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
that.canvas.setAttribute("width", newVal);
if (that.doc._viewarea) {
that.doc._viewarea._width = parseInt(that.canvas.getAttribute("width"), 0);
- //x3dom.debug.logInfo("width: " + that.doc._viewarea._width);
}
break;
case "height":
that.canvas.setAttribute("height", newVal);
if (that.doc._viewarea) {
that.doc._viewarea._height = parseInt(that.canvas.getAttribute("height"), 0);
- //x3dom.debug.logInfo("height: " + that.doc._viewarea._height);
}
break;
@@ -444,7 +443,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.showStat = x3dElem.getAttribute("showStat");
this.statDiv = this.createStatDiv();
this.statDiv.style.display = (this.showStat !== null && this.showStat == "true") ? "inline" : "none";
-
+
this.showProgress = x3dElem.getAttribute("showProgress");
this.progressDiv = this.createProgressDiv();
this.progressDiv.style.display = (this.showProgress == null || this.showProgress == "true") ? "inline" : "none";
@@ -493,12 +492,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.parent.doc.onMousePress(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);
this.parent.doc.needRender = true;
-
- window.status=this.id+' DOWN: '+ pos.x +", "+ pos.y;
- //evt.preventDefault();
- //evt.stopPropagation();
- //evt.returnValue = false;
evt.returnValue = true;
}
}, false);
@@ -510,10 +504,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.parent.doc.onMouseRelease(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);
this.parent.doc.needRender = true;
-
- //evt.preventDefault();
- //evt.stopPropagation();
- //evt.returnValue = false;
+
evt.returnValue = true;
}
}, false);
@@ -525,10 +516,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.parent.doc.onMouseOver(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);
this.parent.doc.needRender = true;
-
- //evt.preventDefault();
- //evt.stopPropagation();
- //evt.returnValue = false;
+
evt.returnValue = true;
}
@@ -541,10 +529,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.parent.doc.onMouseOut(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);
this.parent.doc.needRender = true;
-
- //evt.preventDefault();
- //evt.stopPropagation();
- //evt.returnValue = false;
+
evt.returnValue = true;
}
}, false);
@@ -561,24 +546,13 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.parent.doc.onDoubleClick(that.gl, this.mouse_drag_x, this.mouse_drag_y);
this.parent.doc.needRender = true;
-
-
- window.status=this.id+' DBL: '+ pos.x +", "+ pos.y;
- //evt.preventDefault();
- //evt.stopPropagation();
- //evt.returnValue = false;
evt.returnValue = true;
}
}, false);
this.canvas.addEventListener('mousemove', function (evt) {
if(!this.isMulti) {
- /*
- if (!this.mouse_dragging) {
- return;
- }
- */
if (evt.shiftKey) { this.mouse_button = 1; }
if (evt.ctrlKey) { this.mouse_button = 4; }
@@ -588,19 +562,19 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.mouse_drag_x = pos.x;
this.mouse_drag_y = pos.y;
- if (this.mouse_dragging) {
+ if (this.mouse_dragging) {
this.parent.doc.onDrag(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);
- }
- else {
+ }
+ else {
this.parent.doc.onMove(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);
- }
+ }
this.parent.doc.needRender = true;
+ // deliberately different for performance reasons
evt.preventDefault();
evt.stopPropagation();
evt.returnValue = false;
- //evt.returnValue = true;
}
}, false);
@@ -610,11 +584,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.parent.doc.onDrag(that.gl, this.mouse_drag_x, this.mouse_drag_y, 2);
this.parent.doc.needRender = true;
-
- window.status=this.id+' SCROLL: '+evt.detail;
- //evt.preventDefault();
- //evt.stopPropagation();
- //evt.returnValue = false;
+
evt.returnValue = true;
}
}, false);
@@ -625,11 +595,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.parent.doc.onDrag(that.gl, this.mouse_drag_x, this.mouse_drag_y, 2);
this.parent.doc.needRender = true;
-
- window.status=this.id+' SCROLL: '+evt.detail;
- //evt.preventDefault();
- //evt.stopPropagation();
- //evt.returnValue = false;
+
evt.returnValue = true;
}
}, false);
@@ -661,11 +627,7 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.parent.doc.needRender = true;
evt.returnValue = true;
}, true);
-
- // http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
- // http://backtothecode.blogspot.com/2009/10/javascript-touch-and-gesture-events.html
- // http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/
// Multitouch Events
var touches =
@@ -757,7 +719,6 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
// === Touch Start ===
var touchStartHandler = function(evt, doc)
{
- //x3dom.debug.logWarning("start");
this.isMulti = true;
evt.preventDefault();
touches.visualizeTouches(evt);
@@ -812,7 +773,6 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
var touchStartHandlerMoz = function(evt)
{
- //x3dom.debug.logWarning("start moz");
this.isMulti = true;
evt.preventDefault();
@@ -833,22 +793,11 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
// === Touch Move ===
var touchMoveHandler = function(evt, doc)
{
- //x3dom.debug.logWarning("move");
evt.preventDefault();
touches.visualizeTouches(evt);
- if(doc == null)
- doc = this.parent.doc;
-
- /*for(var i = 0; i < evt.touches.length; i++) {
- for(var i = 0; i < touches.lastLayer.length; i++) {
- if(evt.touches[i].identifier == touches.lastLayer[i][0])
- {
- var pos = mousePosition(evt.touches[i]);
- touches.lastLayer[i] = new Array(evt.touches[i].identifier, new x3dom.fields.SFVec2f(pos.x,pos.y));
- }
- }
- }*/
+ if (doc == null)
+ doc = this.parent.doc;
// one finger: x/y rotation
if(evt.touches.length == 1) {
@@ -896,7 +845,6 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
var touchMoveHandlerMoz = function(evt)
{
- //x3dom.debug.logWarning("move moz");
evt.preventDefault();
for(var i=0; i<mozilla_ids.length; ++i)
@@ -909,7 +857,6 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
// === Touch end ===
var touchEndHandler = function(evt, doc)
{
- //x3dom.debug.logWarning("end");
this.isMulti = false;
evt.preventDefault();
touches.visualizeTouches(evt);
@@ -962,7 +909,6 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
var touchEndHandlerMoz = function(evt)
{
- //x3dom.debug.logWarning("end moz");
this.isMulti = false;
evt.preventDefault();
@@ -985,14 +931,10 @@ x3dom.X3DCanvas = function(x3dElem, canvasIdx) {
this.canvas.addEventListener('MozTouchMove', touchMoveHandlerMoz, true);
this.canvas.addEventListener('MozTouchUp', touchEndHandlerMoz, true);
- // w3c / apple touch events
- // in Chrome via chrome://flags/
+ // w3c / apple touch events (in Chrome via chrome://flags)
this.canvas.addEventListener('touchstart', touchStartHandler, true);
this.canvas.addEventListener('touchmove', touchMoveHandler, true);
this.canvas.addEventListener('touchend', touchEndHandler, true);
- //this.canvas.addEventListener('touchcancel', touchCancelHandler, true);
- //this.canvas.addEventListener('touchleave', touchLeaveHandler, true);
- //this.canvas.addEventListener('touchenter', touchEnterHandler, true);
}
};
@@ -1050,9 +992,6 @@ x3dom.X3DCanvas.prototype.tick = function()
if (this.doc.properties.getProperty("showProgress") !== 'false') {
if (this.progressDiv) {
- // TODO: In order to display a bar we need a max value to determine where we are
- // 100 / total * this.doc.downloadCount
- // this.progressDiv.childNodes[1].setAttribute("style", "width: " + progressPercent + "%");
this.progressDiv.childNodes[0].textContent = 'Loading: ' + (+this.doc.downloadCount);
if (this.doc.downloadCount > 0) {
this.progressDiv.style.display = 'inline';
@@ -1121,7 +1060,7 @@ x3dom.X3DCanvas.prototype.load = function(uri, sceneElemPos, settings) {
this.doc.load(uri, sceneElemPos);
};
-
+/** Helper that converts a point from node coordinates to page coordinates */
function mousePosition(evt) {
var convertPoint = window.webkitConvertPointFromNodeToPage;
@@ -1130,7 +1069,7 @@ function mousePosition(evt) {
if ( "getBoundingClientRect" in document.documentElement ) {
var box = evt.target.offsetParent.getBoundingClientRect();
var scrolleft = window.pageXOffset || document.body.scrollLeft;
- var scrolltop = window.pageYOffset || document.body.scrollTop;
+ var scrolltop = window.pageYOffset || document.body.scrollTop;
var elem = evt.target.offsetParent;
@@ -1157,26 +1096,6 @@ function mousePosition(evt) {
} else {
x3dom.debug.logError('NO getBoundingClientRect, NO webkitConvertPointFromNodeToPage');
- /*TODO Für den Fall das es keine Funktion getBoundingClientRect() gibt
-
- var left = evt.target.offsetParent.offsetLeft; //sollte in eine schleife addiert werden, immer relativ zum offsetParent
- var right = evt.target.offsetParent.offsetRight; //sollte in eine schleife addiert werden, immer relativ zum offsetParent
-
- //probleme bei xhtml und firefox wegen x3d element
-
- var scrolleft = window.pageXOffset || document.body.scrollLeft;
- var scrolltop = window.pageYOffset || document.body.scrollTop;
-
- var elem = evt.target.offsetParent;
-
- var paddingLeft = parseFloat(document.defaultView.getComputedStyle(elem, null).getPropertyValue('padding-left'));
- var borderLeftWidth = parseFloat(document.defaultView.getComputedStyle(elem, null).getPropertyValue('border-left-width'));
-
- var paddingTop = parseFloat(document.defaultView.getComputedStyle(elem, null).getPropertyValue('padding-top'));
- var borderTopWidth = parseFloat(document.defaultView.getComputedStyle(elem, null).getPropertyValue('border-top-width'));
-
- var x = evt.pageX - (left + paddingLeft + borderLeftWidth);
- var y = evt.pageY - (right + paddingTop + borderTopWidth); */
}
return new x3dom.fields.SFVec2f(x, y);
View
20 src/gfx_webgl.js
@@ -20,15 +20,14 @@ x3dom.gfx_webgl = (function () {
this.cached_shader_programs = {};
this.cached_shaders = {};
this.IG_PositionBuffer = null;
- //this.bitLODComposer = null;
//this.imageLoadManager = new x3dom.ImageLoadManager();
}
Context.prototype.getName = function() {
return this.name;
};
- function setupContext(canvas) {
+ function setupContext(canvas, forbidMobileShaders) {
// TODO: add experimental-webgl, webgl test
// x3dom.debug.logInfo("setupContext: canvas=" + canvas);
var validContextNames = ['moz-webgl', 'webkit-3d', 'experimental-webgl', 'webgl'];
@@ -98,8 +97,17 @@ x3dom.gfx_webgl = (function () {
{
x3dom.caps.MOBILE = true;
}
- if (x3dom.caps.MOBILE) {
- x3dom.debug.logWarning("Detected mobile graphics card! Using low quality shaders without ImageGeometry support!");
+ if (x3dom.caps.MOBILE)
+ {
+ if (forbidMobileShaders) {
+ x3dom.caps.MOBILE = false;
+ x3dom.debug.logWarning("Detected mobile graphics card! " +
+ "But being forced to desktop shaders which might not work!");
+ }
+ else {
+ x3dom.debug.logWarning("Detected mobile graphics card! " +
+ "Using low quality shaders without ImageGeometry support!");
+ }
}
}
}
@@ -3243,8 +3251,7 @@ x3dom.gfx_webgl = (function () {
}
//If there is still no BitComposer create a new one
- //if(this.bitLODComposer == null)
- shape._webgl.bitLODComposer = new x3dom.BitLODComposer();
+ shape._webgl.bitLODComposer = new x3dom.BitLODComposer();
var that = this;
@@ -5132,7 +5139,6 @@ x3dom.gfx_webgl = (function () {
if (this._fpTexSupport) {
type = gl.FLOAT;
- //x3dom.debug.logInfo("WebGL backend: found support for floating point textures");
}
scene._webgl = {};
View
13 src/nodes/EnvironmentalEffects.js
@@ -60,7 +60,6 @@ x3dom.registerNodeType(
this.addField_SFFloat(ctx, 'visibilityRange', 0);
},
{
- // methods
}
)
);
@@ -91,7 +90,9 @@ x3dom.registerNodeType(
{
fieldChanged: function(fieldName)
{
- if (fieldName.indexOf("Url") > 0) {
+ if (fieldName.indexOf("Url") > 0 ||
+ fieldName.search("sky") >= 0 ||
+ fieldName.search("ground") >= 0) {
this._dirty = true;
}
else if (fieldName === "set_bind") {
@@ -119,14 +120,6 @@ x3dom.registerNodeType(
this._nameSpace.getURL(this._vf.topUrl[0]),
this._nameSpace.getURL(this._vf.leftUrl[0]),
this._nameSpace.getURL(this._vf.rightUrl[0])
- /*
- this._nameSpace.getURL(this._vf.rightUrl[0]),
- this._nameSpace.getURL(this._vf.leftUrl[0]),
- this._nameSpace.getURL(this._vf.topUrl[0]),
- this._nameSpace.getURL(this._vf.bottomUrl[0]),
- this._nameSpace.getURL(this._vf.frontUrl[0]),
- this._nameSpace.getURL(this._vf.backUrl[0])
- */
];
}
}
View
17 src/nodes/Grouping.js
@@ -426,6 +426,7 @@ x3dom.registerNodeType(
this.addField_SFInt32(ctx, 'maxRenderedIds', -1); // max number of items to be rendered
this.addField_SFBool(ctx, 'reconnect', true); // if true, the node tries to reconnect
this.addField_SFFloat(ctx, 'scaleRenderedIdsOnMove', 1.0); // scaling factor to reduce render calls during navigation (between 0 and 1)
+ this.addField_SFBool(ctx, 'enableCulling', true); // if false, RSG works like normal group
this._idList = []; // to be updated by socket connection
this._websocket = null; // pointer to socket
@@ -571,7 +572,18 @@ x3dom.registerNodeType(
if (!this._vf.render || !out) {
return;
}
-
+
+ if (!this._vf.enableCulling)
+ {
+ for (var j=0; j<this._childNodes.length; j++) {
+ if (this._childNodes[j]) {
+ var childTrafo = this._childNodes[j].transformMatrix(transform);
+ this._childNodes[j].collectDrawableObjects(childTrafo, out);
+ }
+ }
+ return;
+ }
+
if (this._websocket)
this._websocket.updateCamera();
@@ -640,6 +652,9 @@ x3dom.registerNodeType(
this.addField_SFString(ctx, 'pickMode', "idBuf");
// experimental field to switch off picking
this.addField_SFBool(ctx, 'doPickPass', true);
+
+ this._lastMin = null;
+ this._lastMax = null;
},
{
/* bindable getter (e.g. getViewpoint) are added automatically */

0 comments on commit aefcbed

Please sign in to comment.
Something went wrong with that request. Please try again.