/// <summary> /// Removes the collider for this component from the world. /// </summary> public void ClearSpringJoint() { if (Joint == null) { return; } World.Current.PhysicsWorld.RemoveSpringJoint(Joint); Joint = null; }
public void Create(ABRigidBody _a, ABRigidBody _b) { if (Joint != null) { ClearSpringJoint(); } _a.SetConstraints(jointConstraints); _b.SetConstraints(jointConstraints); Joint = new ABSpringJoint(_a, _b); Joint.Stiffness = stiffness; Joint.RestLength = restLength; Joint.Dampen = dampen; World.Current.PhysicsWorld.AddSpringJoint(Joint); }