|
@@ -391,6 +391,12 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
|
|
public overrideMaterialSideOrientation: Nullable<number> = null;
|
|
public overrideMaterialSideOrientation: Nullable<number> = null;
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * Gets or sets a boolean indicating whether to render ignoring the active camera's max z setting. (false by default)
|
|
|
|
+ * Note this will reduce performance when set to true.
|
|
|
|
+ */
|
|
|
|
+ public ignoreCameraMaxZ = false;
|
|
|
|
+
|
|
|
|
+ /**
|
|
* Gets the source mesh (the one used to clone this one from)
|
|
* Gets the source mesh (the one used to clone this one from)
|
|
*/
|
|
*/
|
|
public get source(): Nullable<Mesh> {
|
|
public get source(): Nullable<Mesh> {
|
|
@@ -1829,6 +1835,13 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ let oldCameraMaxZ = 0;
|
|
|
|
+ if (this.ignoreCameraMaxZ && scene.activeCamera && !scene._isInIntermediateRendering()) {
|
|
|
|
+ oldCameraMaxZ = scene.activeCamera.maxZ;
|
|
|
|
+ scene.activeCamera.maxZ = 0;
|
|
|
|
+ scene.updateTransformMatrix(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (this._internalMeshDataInfo._onBeforeRenderObservable) {
|
|
if (this._internalMeshDataInfo._onBeforeRenderObservable) {
|
|
this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);
|
|
this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);
|
|
}
|
|
}
|
|
@@ -1938,6 +1951,12 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
|
|
if (this._internalMeshDataInfo._onAfterRenderObservable) {
|
|
if (this._internalMeshDataInfo._onAfterRenderObservable) {
|
|
this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this);
|
|
this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (this.ignoreCameraMaxZ && scene.activeCamera && !scene._isInIntermediateRendering()) {
|
|
|
|
+ scene.activeCamera.maxZ = oldCameraMaxZ;
|
|
|
|
+ scene.updateTransformMatrix(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|