|
@@ -113,12 +113,6 @@ export class Geometry implements IGetSetVerticesData {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * If set to true (false by defaut), the bounding info applied to the meshes sharing this geometry will be the bounding info defined at the class level
|
|
|
- * and won't be computed based on the vertex positions (which is what we get when useBoundingInfoFromGeometry = false)
|
|
|
- */
|
|
|
- public useBoundingInfoFromGeometry = false;
|
|
|
-
|
|
|
- /**
|
|
|
* Creates a new geometry
|
|
|
* @param id defines the unique ID
|
|
|
* @param scene defines the hosting scene
|
|
@@ -281,8 +275,8 @@ export class Geometry implements IGetSetVerticesData {
|
|
|
var meshes = this._meshes;
|
|
|
var numOfMeshes = meshes.length;
|
|
|
|
|
|
- var minimum = this.useBoundingInfoFromGeometry && this._boundingInfo ? this._boundingInfo.minimum : this._extend.minimum;
|
|
|
- var maximum = this.useBoundingInfoFromGeometry && this._boundingInfo ? this._boundingInfo.maximum : this._extend.maximum;
|
|
|
+ var minimum = this._boundingInfo?.minimum ?? this._extend.minimum;
|
|
|
+ var maximum = this._boundingInfo?.maximum ?? this._extend.maximum;
|
|
|
|
|
|
for (var index = 0; index < numOfMeshes; index++) {
|
|
|
var mesh = meshes[index];
|
|
@@ -350,8 +344,8 @@ export class Geometry implements IGetSetVerticesData {
|
|
|
this._resetPointsArrayCache();
|
|
|
|
|
|
if (updateExtends) {
|
|
|
- var minimum = this.useBoundingInfoFromGeometry && this._boundingInfo ? this._boundingInfo.minimum : this._extend.minimum;
|
|
|
- var maximum = this.useBoundingInfoFromGeometry && this._boundingInfo ? this._boundingInfo.maximum : this._extend.maximum;
|
|
|
+ var minimum = this._boundingInfo?.minimum ?? this._extend.minimum;
|
|
|
+ var maximum = this._boundingInfo?.maximum ?? this._extend.maximum;
|
|
|
|
|
|
var meshes = this._meshes;
|
|
|
for (const mesh of meshes) {
|
|
@@ -729,7 +723,7 @@ export class Geometry implements IGetSetVerticesData {
|
|
|
}
|
|
|
|
|
|
if (kind === VertexBuffer.PositionKind) {
|
|
|
- if (this.useBoundingInfoFromGeometry && this._boundingInfo) {
|
|
|
+ if (this._boundingInfo) {
|
|
|
mesh._boundingInfo = new BoundingInfo(this._boundingInfo.minimum, this._boundingInfo.maximum);
|
|
|
} else {
|
|
|
if (!this._extend) {
|