Hinge

Posted By: Anonymous

Hinge - 08/11/04 03:51

Hi, I have got A6 Pro and i cant work out how to make a hinge work can any one give me some code.
thanx for any help.
Posted By: A.Russell

Re: Hinge - 08/11/04 22:04

Here's mine:

Code:

function init_spinner
{

var constraint2;

phent_settype(my, ph_rigid, ph_poly); //-polygonal collision
constraint2=phcon_add(ph_hinge, my, 0);

phent_setmass(my, 0.5, ph_poly); //lighter than a ball
phent_setfriction(my, 20); //not much friction
phent_setmaxspeed(my,1000,null);
phent_setdamping(my, 0, 20);


phcon_setparams1(constraint2, my.x,vector(0,1,0),nullvector); //anchor point (origin is in centre of entity)
phcon_setparams2(constraint2, vector(360,-360,0),nullvector,nullvector); //can spin all the way around



while(my!=null) //didn't know if a loop was neccessary, so threw it in just in case
{
wait(1);
}

}



If you can make one that doesn't leave it's constraints and fly all over the screen, please tell me how you manage it.
Posted By: Anonymous

Re: Hinge - 08/12/04 00:49

thnx 4 the code. but how do i assign it to my models?
Posted By: A.Russell

Re: Hinge - 08/12/04 01:58



You need to call it from an action.

Code:
   action spinner
{
my.bright=on;
my.flare=on;
init_spinner();
}



Seriously though, hinge is buggy. Good luck with it.
© 2024 lite-C Forums