Table of Contents

Class MoverShapeResponse

Namespace
Stride.CommunityToolkit.Box2D
Assembly
Stride.CommunityToolkit.Box2D.dll

How a shape pushes a CharacterMover2D that runs into it. Stored in the shape's Box2D user data by SetResponse(B2ShapeId, float, bool); a shape without one is rigid and clips the mover's velocity, the sample's default.

public sealed record MoverShapeResponse : IEquatable<MoverShapeResponse>
Inheritance
MoverShapeResponse
Implements

Constructors

MoverShapeResponse(float, bool)

How a shape pushes a CharacterMover2D that runs into it. Stored in the shape's Box2D user data by SetResponse(B2ShapeId, float, bool); a shape without one is rigid and clips the mover's velocity, the sample's default.

public MoverShapeResponse(float MaxPush, bool ClipVelocity)

Parameters

MaxPush float

The furthest the shape may push the mover out per step, in metres. A small value makes a soft obstacle the mover can walk through slowly; MaxValue is rigid.

ClipVelocity bool

Whether the mover's velocity is clipped against the contact plane. On for anything the mover should ride or slide along, like an elevator; off for a soft obstacle it should keep pushing into.

Properties

ClipVelocity

Whether the mover's velocity is clipped against the contact plane. On for anything the mover should ride or slide along, like an elevator; off for a soft obstacle it should keep pushing into.

public bool ClipVelocity { get; init; }

Property Value

bool

MaxPush

The furthest the shape may push the mover out per step, in metres. A small value makes a soft obstacle the mover can walk through slowly; MaxValue is rigid.

public float MaxPush { get; init; }

Property Value

float