Urho.Urho2D.Constraint2D Class

2D physics constraint component.

See Also: Constraint2D

Syntax

public class Constraint2D : Component

Remarks

Base class for the various 2D physics constraints. 

Constraints ('joints' in Box2D terminology) are used to constrain bodies to an anchor point or between themselves. Apply a constraint to a node, called the Constraint2D.OwnerBody and use Constraint2D.OtherBody to set the other node's body to be constrained to the owner body.

See 32_Urho2DConstraints sample for detailed examples and to help selecting the appropriate constraint. 

Following are the available constraints classes, with the indication of the corresponding 'joint' in Box2D manual (see Chapter 8 Joints):

Requirements

Namespace: Urho.Urho2D
Assembly: Urho (in Urho.dll)
Assembly Versions: 1.0.0.0

The members of Urho.Urho2D.Constraint2D are listed below.

See Also: Component

Public Constructors

Constructs a new instance of Urho.Urho2D.Constraint2D which is tied to the Application.CurrentContext.
Constructs a new instance of Urho.Urho2D.Constraint2D, given a raw pointer to an unmanaged object
Constructs a new instance of Urho.Urho2D.Constraint2D linked to a specific Context.

Protected Constructors

Empty constructor, chain to this constructor when you provide your own constructor that sets the handle field.

Public Properties

AttachedConstraintConstraint2D. Return attached constraint (for gear). Or Set attached constriant (for gear).
CollideConnectedBoolean. Return collide connected. Or Set collide connected.
OtherBodyRigidBody2D. Return other body. Or Set other rigid body.
[read-only]
OwnerBodyRigidBody2D. Return owner body.
[read-only]
override
TypeStringHash. Urho's type system type.
[read-only]
override
TypeNameString. Urho's low-level type name.
[read-only]
static
TypeNameStaticString. Urho's low-level type name, accessible as a static method.
[read-only]
static
TypeStaticStringHash. Urho's low-level type, accessible as a static method.

Public Methods

CreateJoint()
Create Joint.
override
OnSetEnabled()
Handle enabled/disabled state change.
static
RegisterObject(Context)
Register object factory.
ReleaseJoint()
Release Joint.