Skip to content

PhysicsBodyComponent.AddSubShape(ShapeDefinition, bool, Nullable, Nullable) Method

Definition

Namespace: Brine2D.ECS.Components

Adds an additional collision shape to this body. Chain shapes are not supported as sub-shapes.

C#
public Brine2D.ECS.Components.SubShape AddSubShape(Brine2D.Physics.ShapeDefinition definition, bool isTrigger=false, System.Nullable<float> friction=null, System.Nullable<float> restitution=null);

Parameters

definition ShapeDefinition

Any ShapeDefinition except ChainShape.

isTrigger System.Boolean

When true, the sub-shape acts as a sensor.

friction System.Nullable<System.Single>

Surface friction override \(0–1\). Pass null to inherit from the body.

restitution System.Nullable<System.Single>

Restitution override \(0–1\). Pass null to inherit from the body.

Returns

SubShape