|
@@ -128,7 +128,6 @@
|
|
|
public definedFacingForward = true; // orientation for POV movement & rotation
|
|
|
public position = Vector3.Zero();
|
|
|
|
|
|
- public isOcclusionQueryInProgress = false;
|
|
|
public occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
|
|
|
public occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;
|
|
|
public occlusionRetryCount = -1;
|
|
@@ -142,6 +141,11 @@
|
|
|
this._isOccluded = value;
|
|
|
}
|
|
|
|
|
|
+ private _isOcclusionQueryInProgress = false;
|
|
|
+ public get isOcclusionQueryInProgress() {
|
|
|
+ return this._isOcclusionQueryInProgress;
|
|
|
+ }
|
|
|
+
|
|
|
private _occlusionQuery: WebGLQuery;
|
|
|
|
|
|
private _rotation = Vector3.Zero();
|
|
@@ -2290,7 +2294,7 @@
|
|
|
if (isOcclusionQueryAvailable) {
|
|
|
var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
|
|
|
|
|
|
- this.isOcclusionQueryInProgress = false;
|
|
|
+ this._isOcclusionQueryInProgress = false;
|
|
|
this._occlusionInternalRetryCounter = 0;
|
|
|
this._isOccluded = occlusionQueryResult === 1 ? false : true;
|
|
|
}
|
|
@@ -2299,7 +2303,7 @@
|
|
|
this._occlusionInternalRetryCounter++;
|
|
|
|
|
|
if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
|
|
|
- this.isOcclusionQueryInProgress = false;
|
|
|
+ this._isOcclusionQueryInProgress = false;
|
|
|
this._occlusionInternalRetryCounter = 0;
|
|
|
|
|
|
// if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
|
|
@@ -2313,7 +2317,6 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var scene = this.getScene();
|
|
|
var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
|
|
|
|
|
@@ -2324,7 +2327,7 @@
|
|
|
engine.beginQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
|
|
|
occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
|
|
|
engine.endQuery(this.occlusionQueryAlgorithmType);
|
|
|
- this.isOcclusionQueryInProgress = true;
|
|
|
+ this._isOcclusionQueryInProgress = true;
|
|
|
}
|
|
|
|
|
|
}
|