diff --git a/docs/api/en/objects/BatchedMesh.html b/docs/api/en/objects/BatchedMesh.html index 1a4fa625c6b9c9..37dcf0eed9e2fc 100644 --- a/docs/api/en/objects/BatchedMesh.html +++ b/docs/api/en/objects/BatchedMesh.html @@ -167,8 +167,21 @@

[page:Integer instanceId]: The id of an instance to get the visibility state of.

-

Get whether the given instance is marked as "visible" or not.

- +

Get whether the given instance is marked as "visible" or not.

+ +

+ [method:Object getGeometryRangeAt]( [param:Integer geometryId], [param:Object target] ) +

+

+ [page:Integer geometryId]: The id of the geometry to get the range of. +

+

+ [page:Object target]: Optional target object to copy the range in to. +

+

Get the range representing the subset of triangles related to the attached geometry, indicating the starting offset and count, or `null` if invalid.

+

Return an object of the form:

+ { start: Integer, count: Integer } +

[method:Integer getGeometryIdAt]( [param:Integer instanceId] )

@@ -176,7 +189,7 @@

[page:Integer instanceId]: The id of an instance to get the geometryIndex of.

Get the geometryIndex of the defined instance.

- +

[method:undefined setColorAt]( [param:Integer instanceId], [param:Color color] )

diff --git a/src/objects/BatchedMesh.js b/src/objects/BatchedMesh.js index 9890bf5feaea35..338fa85e1407f2 100644 --- a/src/objects/BatchedMesh.js +++ b/src/objects/BatchedMesh.js @@ -868,6 +868,23 @@ class BatchedMesh extends Mesh { } + getGeometryRangeAt( geometryId, target = {} ) { + + if ( geometryId < 0 || geometryId >= this._geometryCount ) { + + return null; + + } + + const drawRange = this._drawRanges[ geometryId ]; + + target.start = drawRange.start; + target.count = drawRange.count; + + return target; + + } + raycast( raycaster, intersects ) { const drawInfo = this._drawInfo;