forked from Mirrors/openclonk
Rope: Don't apply repulsive forces on rope segments
parent
bd45ae0fab
commit
886b1e254b
|
@ -299,7 +299,7 @@ void C4Rope::Solve(TRopeType1* prev, TRopeType2* next) //C4RopeSegment* prev, C4
|
|||
// TODO: Could also use an approximation which works without Sqrt, especially
|
||||
// if this becomes a performance bottleneck. http://www.azillionmonkeys.com/qed/sqroot.html
|
||||
C4Real d = ftofix(sqrt(fixtof(dx*dx + dy*dy)));
|
||||
if(d != 0)
|
||||
if(d != 0 && (ApplyRepulsive || d > l))
|
||||
{
|
||||
fx += (dx / d) * k * (d - l);
|
||||
fy += (dy / d) * k * (d - l);
|
||||
|
|
|
@ -107,6 +107,10 @@ private:
|
|||
template<typename TRopeType1, typename TRopeType2>
|
||||
void Solve(TRopeType1* prev, TRopeType2* next);
|
||||
|
||||
// Whether to apply repulsive forces between rope segments.
|
||||
// TODO: Could be made a property...
|
||||
static const bool ApplyRepulsive = false;
|
||||
|
||||
const float w; // Width of rope
|
||||
C4DefGraphics* Graphics;
|
||||
|
||||
|
|
Loading…
Reference in New Issue