i've been created a rope physics, works fine with the "Base" segment and the second, but after the segments are like this:
here is the code:
Code:
action AddSecondaryCable
{
my.tilt -= 90;
my.skill10 = your.skill10-1;
var OtherPos[3];
//
phent_settype(my,PH_RIGID,PH_CYLINDER);
phent_setmass(my,10,PH_BOX);
phent_setfriction(my,50);
phent_setgroup(my,2);
phent_setdamping(my,0,50);
my.skill2 = phcon_add(PH_BALL,my,0);
phcon_setparams1(my.skill2,my.x,nullvector,nullvector);
if(my.skill10 > 0)
{
vec_for_vertex(OtherPos,my,14); //The Rope Tail vertex
ent_create("Cable_Tick.mdl",OtherPos,AddSecondaryCable);
}
while(1)
{
phent_enable(my,0);
vec_for_vertex(my.x,you,14);
phent_enable(my,1);
phcon_setparams1(my.skill2,my.x,nullvector,nullvector);
wait(1);
}
}
action AddBaseCable
{
my.skill10 = your.skill1 - 1;
var OtherPos[3];
vec_for_vertex(OtherPos,my,14);
//
phent_settype(my,PH_RIGID,PH_CYLINDER);
phent_setmass(my,10,PH_BOX);
phent_setfriction(my,50);
phent_setgroup(my,2);
phent_setdamping(my,0,50);
//
my.skill2 = phcon_add(PH_BALL,my,0);
phcon_setparams1(my.skill2,my.x,nullvector,nullvector);
//
BaseSkill = my.skill10;
if(my.skill10 > 0)
{
ent_create("Cable_Tick.mdl",OtherPos,AddSecondaryCable);
}
}
//use Segments_1,Segments_2,Segments_3,Segments_4,Link_1,Link_2,Link_3,Link_4
action Cloth_Line_support
{
my.polygon = on;
var Point1[3];
var Point2[3];
var Point3[3];
var Point4[3];
var To1[3];
var To2[3];
var To3[3];
var To4[3];
vec_for_vertex(Point1,my,1);
vec_for_vertex(Point2,my,2);
vec_for_vertex(Point3,my,3);
vec_for_vertex(Point4,my,4);
if(my.Segments_1 > 0){ent_create("Cable_Tick.mdl",Point1,AddBaseCable);}
}
what is wrong?