|
PH_SLIDER (Problems in Z axis)
#15524
05/05/03 16:21
05/05/03 16:21
|
Joined: Oct 2002
Posts: 120 India
greyplasma
OP
Member
|
OP
Member
Joined: Oct 2002
Posts: 120
India
|
I was trying out Slider Constraint
I made 2 map entities - 1. Hollow Cylinder (One end open) 2. Cylinder with a smaller radius
Something same as the image given in the manual (without the cube though)
I am unable to move them on Z axis
here is my code
// Attached to the cylinder of lower radius
action upper { Up_Piston=my; my.shadow=on; while(Dw_Piston==NULL){wait(1);} phent_settype(my,PH_RIGID,PH_BOX); sleep(1); phent_setgroup(my,2); phent_setmass(my,10,PH_BOX); phent_setfriction(my,0); phent_setelasticity(my,0,0); phent_setdamping(my,0,0); vec_set(p2,vector(0,0,1)); vec_set(p3,vector(-400,400,0)); UPPER_ID=phcon_add(PH_SLIDER,Dw_Piston,my); phcon_setparams1(UPPER_ID,p2,nullvector,nullvector); phcon_setparams2(UPPER_ID,p3,nullvector,nullvector); }
// attached to hollow cylinder action lower { Dw_Piston=my; my.shadow=on; while(Up_Piston==NULL){wait(1);} phent_settype(my,PH_RIGID,PH_BOX); sleep(1); phent_setgroup(my,2); phent_setmass(my,10,PH_BOX); phent_setfriction(my,0); phent_setelasticity(my,0,0); phent_setdamping(my,0,0);
}
// forces
if(key_a==1) { vec_set(m1,vector(-50,250,0)); phcon_setmotor(UPPER_ID,m1,nullvector,nullvector); } if(key_s==1) { vec_set(m1,vector(50,250,0)); phcon_setmotor(UPPER_ID,m1,nullvector,nullvector); }
If i keep the entire system verticle it doesnt work
if i rotate the entire system and change p2 to vec_set(p2,vector(1,0,0)); Same code works.
Moreover if i use PH_CYLINDER instead of PH_BOX my cylinders just penitrate the floor and disappear (as if no collision)
|
|
|
Re: PH_SLIDER (Problems in Z axis)
#15526
05/11/03 06:26
05/11/03 06:26
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
i tried to use a slider for the first time now. it doesn't work at all for me! i experimented with it for over one hour but there seems to be no way to get it working. and i get an error E1513 with: slider1_id=phcon_add(PH_SLIDER,my,0); why isn't it possible to constrain it to the world?
|
|
|
Re: PH_SLIDER (Problems in Z axis)
#15530
05/16/03 08:03
05/16/03 08:03
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
quote: Originally posted by ventilator: and i get an error E1513 with: slider1_id=phcon_add(PH_SLIDER,my,0); why isn't it possible to constrain it to the world?
Because of a bug in the engine- I am trying to query the 2nd object's position, which is not a good idea if there is no second object.. Fixed.
|
|
|
|