3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Newbie Question
[Re: A.Russell]
#27648
06/06/04 22:47
06/06/04 22:47
|
Joined: Mar 2003
Posts: 5,377 USofA
fastlane69
Senior Expert
|
Senior Expert
Joined: Mar 2003
Posts: 5,377
USofA
|
Quote:
Also, is there a way to stop the entity from spinning?
Set phent_maxspeed(linMax,Null) and this will limit the entities linear speed to linMax and it's Rotational speed to Zero.
Quote:
constaint1[3]=1,0,0; //only allows movement on x axis?
That's right...so if your "chute" isn't lined up right, you'll get odd effects indeed.
Quote:
phcon_setparams1(constraint1, vector(1,0,0),nullvector,nullvector); // I thought that the second agument of this set the contraint axis?
I"m sorry Russel...constraint1 is the problem, but I gave you the wrong solution.
constraint1=phcon_add(ph_slider, my, 0);
There that should do it. Forget that constraint vector buisness, you are right; vector() is constraint axis. Sorry for the confusion.
|
|
|
Re: Newbie Question
[Re: A.Russell]
#27650
06/07/04 18:52
06/07/04 18:52
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
OP
Expert
|
OP
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
pjhent_setmaxspeed didn't do anything. It still rotates around. When a ball hits the ball luncher, it gets bumped around to the wrong angle, and then goes all to hell bouncing and twirling all over the place.
To tell the truth, I don't understand about things like velocities and torque, so I probably have a few other settings off:
Code:
function init_ball_launcher()
{
var constraint1[3];
phent_settype(my, ph_rigid, ph_box);
constraint1=phcon_add(ph_slider, my, 0);
phent_setmaxspeed(my,10000,null); //this doesn't stop rotation (I tried with other values too)
phcon_setparams1(constraint1, vector(1,0,0),nullvector,nullvector); //limit movement to the x axis
phcon_setparams2(constraint1, vector(-50,0,0),nullvector,nullvector); //can't (shouldn't be able) to move more than 50 quants
while(my!=null)
{
temp.x=-spring;//The amount of force to move the ball launcher
temp.y=-1600000;//maximum force for the ball launcher
temp.z=0
//punch ball out chute
//should make it so that it moves back and forth in 1 second intervals
//seems to work okay until the ball launcher hits a ball and rotates around
phcon_setmotor(constraint1, temp, nullvector, nullvector);
sleep(0.5);
temp.y-=temp.x;
phcon_setmotor(constraint1, temp, nullvector, nullvector);
sleep(0.5);
}
}
Last edited by A.Russell; 06/07/04 19:26.
|
|
|
Re: Newbie Question
[Re: A.Russell]
#27654
06/11/04 17:42
06/11/04 17:42
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
OP
Expert
|
OP
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
I'm getting back to making the spinners. I'm finding this very difficult, and don't really know how to approach it.
The spinners are not motorised, they should simply spin when balls hit them.
Here is a picture of the entity for the spinners:
Last edited by A.Russell; 06/11/04 17:43.
|
|
|
Re: Newbie Question
[Re: A.Russell]
#27655
06/12/04 13:13
06/12/04 13:13
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
OP
Expert
|
OP
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
I attempted to make the spinner from a hinge. It doesn't move at all. I assigned the spinner entities this action:
Code:
action init_spinner
{
var constraint2;
phent_settype(my, ph_rigid, ph_poly); //ph_poly -polygonal collision?
constraint2=phcon_add(ph_hinge, my, 0); //a hinge would be all that is needed in case, right?
phent_setmass(my, 0.5, ph_poly); //lighter than a ball
phent_setfriction(my, 10); //not much friction
phcon_setparams1(constraint2, my.x,vector(0,0,1),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);
}
}
I've commented what I thought I was doing.
EDIT> Nevermind, fixed it. Amazing what a lunch break can do.
Last edited by A.Russell; 06/12/04 14:03.
|
|
|
|