예제 #1
0
        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);
        }
예제 #2
0
        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);
            }
        }