public SpringConstraint(AbstractParticle p1, AbstractParticle p2, float stiffness, bool collidable, float rectHeight, float rectScale, bool scaleToLength) : base(stiffness) { _scp = null; this.p1 = p1; this.p2 = p2; checkParticlesLocation(); _restLength = this.CurrLength; setCollidable(collidable, rectHeight, rectScale, scaleToLength); }
public void setCollidable(bool b, float rectHeight, float rectScale, bool scaleToLength) { _collidable = b; _scp = null; if (_collidable) { _scp = new SpringConstraintParticle(p1, p2, this, rectHeight, rectScale, scaleToLength); } }