Rope: Choose some sane defaults for k and rho

rope
Armin Burgmeier 2012-04-28 13:54:03 +02:00
parent a4b455a2a4
commit 4b8c7e9c6a
2 changed files with 2 additions and 2 deletions

View File

@ -2,5 +2,5 @@ func Initialize()
{
var a = CreateObject(Rock, 100, 100, NO_OWNER);
var b = CreateObject(Rock, 200, 100, NO_OWNER);
a->CreateRope2(a, b, 100);
a->CreateRope2(a, b, 20);
}

View File

@ -104,7 +104,7 @@ void C4RopeEnd::Execute(C4Real dt)
C4Rope::C4Rope(C4Object* first_obj, C4Object* second_obj, int32_t n_segments):
n_segments(n_segments), l(ObjectDistance(first_obj, second_obj) / (n_segments + 1)),
k(Fix1), rho(Fix0), /* TODO: proper default values for k and rho */ n_iterations(5)
k(Fix1*3), rho(Fix1*3), /* TODO: proper default values for k and rho */ n_iterations(20)
{
if(!PathFree(first_obj->GetX(), first_obj->GetY(), second_obj->GetX(), second_obj->GetY()))
throw C4RopeError("Failed to create rope: Path between objects is blocked");