DampedSpring class

Inheritance

Constructors

DampedSpring({required Body a, required Body b, required Vector2 anchorA, required Vector2 anchorB, required double restLength, required double stiffness, required double damping})

Properties

a Body
no setterinherited
b Body
no setterinherited
errorBias double
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isExist bool
no setterinherited
maxForce double
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() → void
Destroy a constraint.
override
getAnchorA() → Vector2
Get the location of the first anchor relative to the first body.
getAnchorB() → Vector2
Get the location of the second anchor relative to the second body.
getBodyA() Body
Get the first body the constraint is attached to.
inherited
getBodyB() Body
Get the second body the constraint is attached to.
inherited
getCollideBodies() bool
Get if the two bodies connected by the constraint are allowed to collide or not.
inherited
getDamping() double
Get the damping of the spring.
getData<T>() → T?
Get the user data assigned to the constraint.
inherited
getErrorBias() double
Get rate at which joint error is corrected.
inherited
getImpulse() double
Get the last impulse applied by this constraint.
inherited
getMaxBias() double
Get the maximum rate at which joint error is corrected.
inherited
getMaxForce() double
Get the maximum force that this constraint is allowed to use.
inherited
getRestLength() double
Get the rest length of the spring.
getSpace() Space
Get the cpSpace this constraint is added to.
inherited
getStiffness() double
Get the stiffness of the spring in force/distance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeData() → void
Remove the user data assigned to the constraint.
inherited
setAnchorA(Vector2 anchorA) → void
Set the location of the first anchor relative to the first body.
setAnchorB(Vector2 anchorA) → void
Set the location of the second anchor relative to the second body.
setCollideBodies(bool collideBodies) → void
Set if the two bodies connected by the constraint are allowed to collide or not. (defaults to cpFalse)
inherited
setCollideBody(bool collideBodies) → void
Set if the two bodies connected by the constraint are allowed to collide or not. (defaults to cpFalse)
inherited
setDamping(double damping) → void
Set the damping of the spring.
setData<T>(T data) → void
Set the user data assigned to the constraint.
inherited
setErrorBias(double errorBias) → void
Set 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.
inherited
setMaxBias(double maxBias) → void
Set the maximum rate at which joint error is corrected. (defaults to INFINITY)
inherited
setMaxForce(double force) → void
Set the maximum force that this constraint is allowed to use. (defaults to INFINITY)
inherited
setPostSolveFunc(void postSolveFunc(Constraint constraint, Space space)) → void
Set the post-solve function that is called before the solver runs.
inherited
setPreSolveFunc(void preSolveFunc(Constraint constraint, Space space)) → void
Set the pre-solve function that is called before the solver runs.
inherited
setRestLength(double restLength) → void
Set the rest length of the spring.
setSpringForceFunc(double springForceFunc(DampedSpring constraint, double dist)) → void
Set the damping of the spring.
setStiffness(double stiffness) → void
Set the stiffness of the spring in force/distance.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited