diff --git a/docs/api/en/objects/BatchedMesh.html b/docs/api/en/objects/BatchedMesh.html index 927d9ce0500940..417ef92361ade1 100644 --- a/docs/api/en/objects/BatchedMesh.html +++ b/docs/api/en/objects/BatchedMesh.html @@ -38,11 +38,11 @@

Code Example

const sphereGeometryId = batchedMesh.addGeometry( sphere ); // create instances of those geometries - const boxInstancedId1 = batchedMesh.addInstance( boxGeometryId ); + const boxInstancedId1 = batchedMesh.addInstance( boxGeometryId ); const boxInstancedId2 = batchedMesh.addInstance( boxGeometryId ); - const sphereInstancedId1 = batchedMesh.addInstance( sphereGeometryId ); - const sphereInstancedId2 = batchedMesh.addInstance( sphereGeometryId ); + const sphereInstancedId1 = batchedMesh.addInstance( sphereGeometryId ); + const sphereInstancedId2 = batchedMesh.addInstance( sphereGeometryId ); // position the geometries batchedMesh.setMatrixAt( boxInstancedId1, boxMatrix1 ); @@ -100,9 +100,9 @@

[property:Boolean sortObjects]

rendered front to back. Default is `true`.

-

[property:Integer maxGeometryCount]

+

[property:Integer maxInstanceCount]

- The maximum number of individual geometries that can be stored in the [name]. Read only. + The maximum number of individual instances that can be stored in the [name]. Read only.

[property:Boolean isBatchedMesh]

@@ -231,7 +231,7 @@

[method:Integer addInstance]( [param:Integer geometryId] )

- [page:Integer geometryId]: The id of a previously added geometry via "addGeometry" to add into the [name] to render. + [page:Integer geometryId]: The id of a previously added geometry via "addGeometry" to add into the [name] to render.

Adds a new instance to the [name] using the geometry of the given geometryId and returns a new id referring to the new instance to be used diff --git a/docs/api/zh/objects/BatchedMesh.html b/docs/api/zh/objects/BatchedMesh.html index b03898fe00c455..78484205997187 100644 --- a/docs/api/zh/objects/BatchedMesh.html +++ b/docs/api/zh/objects/BatchedMesh.html @@ -49,12 +49,12 @@

例子

构造函数

[name]( - [param:Integer maxGeometryCount], [param:Integer maxVertexCount], + [param:Integer maxInstanceCount], [param:Integer maxVertexCount], [param:Integer maxIndexCount], [param:Material material], )

- [page:Integer maxGeometryCount] - 计划添加的单个几何体的最大数量。
+ [page:Integer maxInstanceCount] - 计划添加的单个几何体的最大数量。
[page:Integer maxVertexCount] - 所有几何体使用的最大顶点数。
[page:Integer maxIndexCount] - 所有几何图形使用的最大索引数。
[page:Material material] - [page:Material] 的一个实例。默认是新的 [page:MeshBasicMaterial]。
@@ -83,7 +83,7 @@

[property:Boolean sortObjects]

如果为 true,则对 [name] 中的各个对象进行排序以改善与过度绘制相关的工件。如果材质被标记为“透明”,则对象将从后到前渲染,如果没有,则它们从前到后渲染。默认为 `true`。

-

[property:Integer maxGeometryCount]

+

[property:Integer maxInstanceCount]

只读,[name] 中可以存储的单个几何体的最大数量。

@@ -222,4 +222,4 @@

源代码

- \ No newline at end of file + diff --git a/examples/webgl_mesh_batch.html b/examples/webgl_mesh_batch.html index 326679dd6457ac..a65229f841b990 100644 --- a/examples/webgl_mesh_batch.html +++ b/examples/webgl_mesh_batch.html @@ -293,7 +293,7 @@ // initialize options this._options = this._options || { get: el => el.z, - aux: new Array( this.maxGeometryCount ) + aux: new Array( this.maxInstanceCount ) }; const options = this._options; diff --git a/examples/webgpu_mesh_batch.html b/examples/webgpu_mesh_batch.html index b277dc664f9b9a..590988d6aceb6c 100644 --- a/examples/webgpu_mesh_batch.html +++ b/examples/webgpu_mesh_batch.html @@ -50,7 +50,7 @@ let gui; let geometries, mesh, material; const ids = []; - + const matrix = new THREE.Matrix4(); // @@ -313,7 +313,7 @@ controls.update(); - + if ( mesh.isBatchedMesh ) { mesh.sortObjects = api.sortObjects; @@ -355,7 +355,7 @@ // initialize options this._options = this._options || { get: el => el.z, - aux: new Array( this.maxGeometryCount ) + aux: new Array( this.maxInstanceCount ) }; const options = this._options; diff --git a/src/core/Object3D.js b/src/core/Object3D.js index 4aad71c50e3df3..55b52c44b7c104 100644 --- a/src/core/Object3D.js +++ b/src/core/Object3D.js @@ -752,7 +752,7 @@ class Object3D extends EventDispatcher { sphereCenter: bound.sphere.center.toArray() } ) ); - object.maxGeometryCount = this._maxGeometryCount; + object.maxInstanceCount = this._maxInstanceCount; object.maxVertexCount = this._maxVertexCount; object.maxIndexCount = this._maxIndexCount; diff --git a/src/loaders/ObjectLoader.js b/src/loaders/ObjectLoader.js index a0531f3c535ea8..3895d6628a94a1 100644 --- a/src/loaders/ObjectLoader.js +++ b/src/loaders/ObjectLoader.js @@ -908,7 +908,7 @@ class ObjectLoader extends Loader { geometry = getGeometry( data.geometry ); material = getMaterial( data.material ); - object = new BatchedMesh( data.maxGeometryCount, data.maxVertexCount, data.maxIndexCount, material ); + object = new BatchedMesh( data.maxInstanceCount, data.maxVertexCount, data.maxIndexCount, material ); object.geometry = geometry; object.perObjectFrustumCulled = data.perObjectFrustumCulled; object.sortObjects = data.sortObjects; @@ -938,7 +938,7 @@ class ObjectLoader extends Loader { } ); - object._maxGeometryCount = data.maxGeometryCount; + object._maxInstanceCount = data.maxInstanceCount; object._maxVertexCount = data.maxVertexCount; object._maxIndexCount = data.maxIndexCount;