Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,501 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
PH_SLIDER (Problems in Z axis) #15524
05/05/03 16:21
05/05/03 16:21
Joined: Oct 2002
Posts: 120
India
G
greyplasma Offline OP
Member
greyplasma  Offline OP
Member
G

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) #15525
05/07/03 15:22
05/07/03 15:22
Joined: Oct 2002
Posts: 120
India
G
greyplasma Offline OP
Member
greyplasma  Offline OP
Member
G

Joined: Oct 2002
Posts: 120
India
I am still stuck on this
maybe i am doing some really stupid error

Any helps please

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 Offline
Senior Expert
ventilator  Offline
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. [Frown]

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) #15527
05/11/03 07:04
05/11/03 07:04
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i found my mistake! i constrained the slider and some other objects to an anchor object with mass 0. all objects that get connected to an object with mass 0 seem to freeze. and if other physics objects collide with the frozen constrained objects they freeze too! marco, is this a bug?

now i use a hinge constrained to the world for my anchor object.

@greyplasma: try to use bigger force values for your motors. i had to use values around 100000 to get it moving...

Re: PH_SLIDER (Problems in Z axis) #15528
05/11/03 07:32
05/11/03 07:32
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
...using a combination of more than 15 constraints i have a fully functional crane simulator now! with realistic wire physics!

...wow! controlling a crane is really difficult! [Big Grin]

Re: PH_SLIDER (Problems in Z axis) #15529
05/13/03 15:25
05/13/03 15:25
Joined: Oct 2002
Posts: 120
India
G
greyplasma Offline OP
Member
greyplasma  Offline OP
Member
G

Joined: Oct 2002
Posts: 120
India
Thanks Ventilator,

It worked finally, you were right about appying a higher force value,

Your crane simulator seems really nice, please do share your programming experiences.

Thanks

Re: PH_SLIDER (Problems in Z axis) #15530
05/16/03 08:03
05/16/03 08:03

A
Anonymous
Unregistered
Anonymous
Unregistered
A



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.

Re: PH_SLIDER (Problems in Z axis) #15531
08/11/03 22:11
08/11/03 22:11
Joined: Sep 2001
Posts: 237
Maine, USA
J
Jason Bryant Offline
Member
Jason Bryant  Offline
Member
J

Joined: Sep 2001
Posts: 237
Maine, USA
Hi. I am getting an error using the slider joint as well. (The error flashes on and off too fast for me read it.) I have been trying to constrain it to the world as well.

This is listed as fixed below and this topic is from May (3 months ago). Is this fixed in any public version or does fixed refer to the private beta?

What is the best simple work around for this assuming this is still bugged in the public release? Is constraining it to another physics object the only method for a slider constraint to work? Does the 2nd physics object have to be active? What restrictions are there? It can't have a mass of 0?

thanks for any help,
Jason

Re: PH_SLIDER (Problems in Z axis) #15532
08/11/03 22:48
08/11/03 22:48
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
a work around for this bug would be to attach a hinge with all limits set to 0 to the world and attach the slider to this hinge then.

attaching things to an object with mass 0 leads to strange results.

Re: PH_SLIDER (Problems in Z axis) #15533
08/11/03 22:57
08/11/03 22:57
Joined: Sep 2001
Posts: 237
Maine, USA
J
Jason Bryant Offline
Member
Jason Bryant  Offline
Member
J

Joined: Sep 2001
Posts: 237
Maine, USA
Thanks ventilator.

Does it matter where I position the hinge? I am assuming I can position the hinge somewhere out of sight and the location is of no issue.

edit - And, am I allowed to attach an arbitrary number of constraints to this hinge? For example, I could attach several blocks that I want to have as slider joints constrained to this one hinge? Hope thats readable.

thanks,
Jason

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1