SkinnedBatch
Copies of one skinned model, drawn together. Place it in the scene
once, anywhere, and add each copy, a clone with bones of its own such
as SkeletonUtils.clone makes; each part then draws every shown copy
at its own pose in one draw, and once more into each shadow map. While
a copy is in the batch, the part’s material draws it, not its own, and
its meshes’ own visible is the batch’s: hide a copy, or a part of
one, by a group that holds it.
Extends
Section titled “Extends”Group
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Uniforms extends SkinnedBatchUniforms |
SkinnedBatchUniforms |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SkinnedBatch<
Uniforms>(source,options?):SkinnedBatch<Uniforms>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
Object3D |
options |
SkinnedBatchOptions<Uniforms> |
Returns
Section titled “Returns”SkinnedBatch<Uniforms>
Overrides
Section titled “Overrides”Group.constructor
Properties
Section titled “Properties”onEmpty
Section titled “onEmpty”onEmpty: (() =>
void) |undefined
Runs as the last copy leaves.
readonlyparts: readonlySkinnedBatchPart[]
A part for each mesh of the model the batch draws.
Accessors
Section titled “Accessors”copyCount
Section titled “copyCount”Get Signature
Section titled “Get Signature”get copyCount():
number
Returns
Section titled “Returns”number
Methods
Section titled “Methods”addCopy()
Section titled “addCopy()”addCopy(
root):SkinnedCopy<Uniforms>
Draws root’s meshes in the batch from the next draw on, in place
of their own draws: root is a clone of the model the batch was made
from, each skinned mesh at the same place in its tree and sharing its
geometry. A mesh hidden as it is added keeps drawing itself, hidden.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
root |
Object3D |
Returns
Section titled “Returns”SkinnedCopy<Uniforms>
dispose()
Section titled “dispose()”dispose():
void
Frees the draws’ textures and its own materials: the copies keep
theirs, and the game keeps what dress gave.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”Group.dispose
findPart()
Section titled “findPart()”findPart(
mesh):SkinnedPart|undefined
The part mesh draws.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
mesh |
InstancedMesh2 |
Returns
Section titled “Returns”SkinnedPart | undefined
holdWarmUp()
Section titled “holdWarmUp()”holdWarmUp(): () =>
void
Draws one instance in each part, with every bone zero so it covers no pixel, until the returned call lets go: a batch with no copy draws nothing, so the first copy’s draw would be each part’s first, and the GPU process builds a draw’s vertex layout then, 19 to 44 ms of Holdfast’s first wave on Chrome’s Direct3D backend. Held under the loading screen, that first draw happens there. Holds count.
Returns
Section titled “Returns”() => void
update()
Section titled “update()”update():
void
Writes each shown copy’s pose, colour and uniforms into its parts’ draws. Each part’s draw runs it once a render, after the frame’s matrices are up to date.
Returns
Section titled “Returns”void
updateOnce()
Section titled “updateOnce()”updateOnce(
frame):void
update, once for each of the renderer’s renders.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
frame |
number |
Returns
Section titled “Returns”void