Table of Contents

Class PhysicsConstraintComponent

Namespace
Stride.Physics
Assembly
Stride.Physics.dll

A component descrbing a physical constraint between two rigidbodies or a rigidbody and world.

[DataContract("PhysicsConstraintComponent")]
[Display("Physics Constraint", null)]
[DefaultEntityComponentProcessor(typeof(PhysicsConstraintProcessor), ExecutionMode = ExecutionMode.Runtime)]
[ComponentOrder(3010)]
[ComponentCategory("Physics")]
public class PhysicsConstraintComponent : ActivableEntityComponent, IIdentifiable
Inheritance
PhysicsConstraintComponent
Implements
Inherited Members

Properties

BodyA

(Required) Rigidbody A used for body-body and body-world constraints.

public RigidbodyComponent BodyA { get; set; }

Property Value

RigidbodyComponent

BodyB

(Optional) Rigidbody B used for body-body constraints.

public RigidbodyComponent BodyB { get; set; }

Property Value

RigidbodyComponent

Constraint

Constructed constraint object.

public Constraint Constraint { get; }

Property Value

Constraint

Description

Description of the constraint to create.

public IConstraintDesc Description { get; set; }

Property Value

IConstraintDesc

DisableCollisionsBetweenBodies

When true, body A and body B will not collide with each other.

public bool DisableCollisionsBetweenBodies { get; set; }

Property Value

bool

Simulation

Simulation to which this constraint was added.

public Simulation Simulation { get; }

Property Value

Simulation

Methods

RecreateConstraint()

Removes the currently used Constraint and recreates it.

public void RecreateConstraint()

Remarks

Needs to be called after modifying any of the properties.

Events

OnDetach

Invoked when a constraint is broken because one of the rigidbodies involved in the constraint is removed from the scene.

public event Action<PhysicsConstraintComponent> OnDetach

Event Type

Action<PhysicsConstraintComponent>