Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

PhysicsShape.SetBatchGeometry

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, ReadOnlySpan<CircleGeometry> geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on each corresponding shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid).

Description

Set a batch of PhysicsShape to the corresponding CircleGeometry. The two spans must be the same length; shape[i] is set to geometry[i]. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes or geometry in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, ReadOnlySpan<CapsuleGeometry> geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on each corresponding shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid).

Description

Set a batch of PhysicsShape to the corresponding CapsuleGeometry. The two spans must be the same length; shape[i] is set to geometry[i]. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes or geometry in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, ReadOnlySpan<PolygonGeometry> geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on each corresponding shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid).

Description

Set a batch of PhysicsShape to the corresponding PolygonGeometry. The two spans must be the same length; shape[i] is set to geometry[i]. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes or geometry in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, ReadOnlySpan<SegmentGeometry> geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on each corresponding shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid).

Description

Set a batch of PhysicsShape to the corresponding SegmentGeometry. The two spans must be the same length; shape[i] is set to geometry[i]. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes or geometry in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, ReadOnlySpan<ChainSegmentGeometry> geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on each corresponding shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid).

Description

Set a batch of PhysicsShape to the corresponding ChainSegmentGeometry. The two spans must be the same length; shape[i] is set to geometry[i]. If a shape is already a chain segment, its owning chain is preserved. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes or geometry in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, CircleGeometry geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on every shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid). If the geometry is invalid, no shapes are set.

Description

Set a batch of PhysicsShape all to the same CircleGeometry. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, CapsuleGeometry geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on every shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid). If the geometry is invalid, no shapes are set.

Description

Set a batch of PhysicsShape all to the same CapsuleGeometry. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, PolygonGeometry geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on every shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid). If the geometry is invalid, no shapes are set.

Description

Set a batch of PhysicsShape all to the same PolygonGeometry. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, SegmentGeometry geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on every shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid). If the geometry is invalid, no shapes are set.

Description

Set a batch of PhysicsShape all to the same SegmentGeometry. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.


Declaration

public static int SetBatchGeometry(ReadOnlySpan<PhysicsShape> shapes, ChainSegmentGeometry geometry);

Parameters

Parameter Description
shapes The shapes to set.
geometry The geometry to set on every shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid). If the geometry is invalid, no shapes are set.

Description

Set a batch of PhysicsShape all to the same ChainSegmentGeometry. If a shape is already a chain segment, its owning chain is preserved. Like the single geometry setters, this updates the shape type and broadphase but does not update body mass. Call PhysicsBody.ApplyMassFromShapes on any affected body if a mass update is required. Invalid shapes in the batch are ignored. For best performance, the shapes should all be part of the same PhysicsWorld, sorted by world otherwise.