Class Constraint
Definition
- Assembly:
- Tizen.NUI.Physics2D.dll
Base class of all constraints. You usually don’t want to create instances of this class directly, but instead use one of the specific constraints such as the PinJoint.
public abstract class Constraint : IDisposable
- Inheritance
-
objectConstraint
- Derived
Constructors
View SourceConstraint(IntPtr)
Construct a constraint with the given native handle.
Declaration
protected Constraint(System.IntPtr handle)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | handle |
Properties
View SourceBodyA
Get the first body the constraint is attached to.
Declaration
public Body BodyA { get; }
Property Value
Type | Description |
---|---|
Body |
BodyB
Get the second body the constraint is attached to.
Declaration
public Body BodyB { get; }
Property Value
Type | Description |
---|---|
Body |
CollideBodies
Whether the two bodies connected by the constraint are allowed to collide or not.
When two bodies collide, Chipmunk ignores the collisions if this property is set to False on any constraint that connects the two bodies. Defaults to True. This can be used to create a chain that self-collides, but adjacent links in the chain do not collide.
Declaration
public bool CollideBodies { get; set; }
Property Value
Type | Description |
---|---|
bool |
Data
The user-definable data pointer for this constraint.
Declaration
public object Data { get; set; }
Property Value
Type | Description |
---|---|
object |
ErrorBias
Rate at which joint error is corrected. Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
Declaration
public double ErrorBias { get; set; }
Property Value
Type | Description |
---|---|
double |
Handle
Native handle to constraint.
Declaration
public System.IntPtr Handle { get; }
Property Value
Type | Description |
---|---|
System.IntPtr |
Impulse
Get the last impulse applied by this constraint.
Declaration
public double Impulse { get; }
Property Value
Type | Description |
---|---|
double |
MaxBias
The maximum rate at which joint error is corrected.
Declaration
public double MaxBias { get; set; }
Property Value
Type | Description |
---|---|
double |
MaxForce
; The maximum force that this constraint is allowed to use.
Declaration
public double MaxForce { get; set; }
Property Value
Type | Description |
---|---|
double |
PostSolve
Post-solve function that is called after the solver runs.
Declaration
public Action<Constraint, Space> PostSolve { get; set; }
Property Value
Type | Description |
---|---|
Action<, ><Constraint, Space> |
PreSolve
Pre-solve function that is called before the solver runs.
Declaration
public Action<Constraint, Space> PreSolve { get; set; }
Property Value
Type | Description |
---|---|
Action<, ><Constraint, Space> |
Space
Get the cpSpace this constraint is added to.
Declaration
public Space Space { get; }
Property Value
Type | Description |
---|---|
Space |
Methods
View SourceDispose()
Destroy the constraint
Declaration
public void Dispose()
Dispose(bool)
Dispose the constraint.
Declaration
protected virtual void Dispose(bool dispose)
Parameters
Type | Name | Description |
---|---|---|
bool | dispose |
Free()
Destroy and free the constraint.
Declaration
public void Free()
FromHandle(IntPtr)
Get a Constraint object from a native handle.
Declaration
public static Constraint FromHandle(System.IntPtr constraint)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | constraint |
Returns
Type | Description |
---|---|
Constraint |