Class PhysicsConstraintComponent
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
BodyB
(Optional) Rigidbody B used for body-body constraints.
public RigidbodyComponent BodyB { get; set; }
Property Value
Constraint
Constructed constraint object.
public Constraint Constraint { get; }
Property Value
Description
Description of the constraint to create.
public IConstraintDesc Description { get; set; }
Property Value
DisableCollisionsBetweenBodies
When true, body A and body B will not collide with each other.
public bool DisableCollisionsBetweenBodies { get; set; }
Property Value
Simulation
Simulation to which this constraint was added.
public Simulation Simulation { get; }
Property Value
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