| Parameter | Description |
|---|---|
| batch | The batch of bodies and values to set. |
Set the transform for a batch of PhysicsBody using a span of BatchTransform. If invalid values are passed to the batch, they will simply be ignored. For best performance, the bodies contained in the batch should all be part of the same PhysicsWorld. If the bodies in the batch are not contained in the same PhysicsWorld, the batch should be sorted by the PhysicsWorld the bodies are contained within.
| Parameter | Description |
|---|---|
| batch | The batch of bodies and values to set. |
| writePoses | Whether to also write the poses to the PhysicsBody.transformObject of each body in the batch. |
Set the transform for a batch of PhysicsBody using a span of BatchTransform, optionally writing each pose to the PhysicsBody.transformObject of its body.
If invalid values are passed to the batch, they will simply be ignored.
When writePoses is true, each pose set is also written to the PhysicsBody.transformObject of its body, without producing a TransformChangeEvent.
Writing poses requires all the valid bodies in the batch to be in the same PhysicsWorld and each to have its own PhysicsBody.transformObject assigned, not shared with another body in the batch.
Invalid bodies in the batch are still simply ignored.
The PhysicsWorld.transformWriteMode and PhysicsBody.transformWriteMode do not control this explicit write, except that PhysicsWorld.TransformWriteMode.Fast2D selects the faster rotation write.
Writing poses must be done on the main thread.