Physic do some strange things

Posted By: Ralph

Physic do some strange things - 04/27/09 08:14

I have a big problem, i want that my weapons fall down like in reality. But the physic do some strange things..

Some of the AK's are fallen into the terrian, some fly 100 miles away when they hit the terrian and some stuck in the terrian.
What can i do to fix that?
Here is my code:
Code:
void waeponOnGround_main()
{
	wait(1); 
	c_setminmax(me);
	me.ambient = 100;
	me.pan = 10; me.tilt = -10; me.roll = 110;
	phent_settype(me,PH_RIGID,PH_BOX);
	phent_setmass(me,1,PH_BOX);
	phent_setfriction(me,100);
	phent_setelasticity(me,10,5);
	phent_setdamping(me,50,100);
	ph_setgravity(vector(0,0,-500));
	ph_setautodisable(0.05, 0.02, 10, 0.1);
	VECTOR vDrop;
   vDrop.x = 10; vDrop.y = 0; vDrop.z = 75;
   phent_addvelcentral(me,vDrop);
	me.material = mat_metal;
	//set(me,SHADOW);
	while(me != NULL)
	{
		if(vec_dist(my.x,player.x)>20)
		{
			if(player.skill8 == 0)
			{
				player.skill8 = 1;
				ent_remove(me);
			}
		}
		wait(1);
	}
}

Thanks, Ralph.
Posted By: Jaxas

Re: Physic do some strange things - 04/27/09 09:25

this is the action of AK? why void not action?
Posted By: Ralph

Re: Physic do some strange things - 04/27/09 16:20

Originally Posted By: Jaxas
this is the action of AK? why void not action?

#1 Yes this is the "action" of the AK.
#2 Because they are the same! (typedef void action; <-- this is from the acknex.h)

And now no off-topic questions,please.
I really need help with it!
Posted By: Cowabanga

Re: Physic do some strange things - 04/27/09 17:36

Quote:
Some of the AK's are fallen into the terrian

Because they're acting like a box.

Quote:
some fly 100 miles away when they hit the terrian

Decrease the bouncing.
Posted By: Ralph

Re: Physic do some strange things - 04/27/09 18:19

Quote:
Quote:
Some of the AK's are fallen into the terrian

Because they're acting like a box.

So its normal that a box fall into the terrian or stuck in it?? smirk

Quote:
Quote:
some fly 100 miles away when they hit the terrian

Decrease the bouncing.

I say "some" not all, some of them are acting like they should and some do this strange things...
Posted By: Cowabanga

Re: Physic do some strange things - 04/27/09 18:23

1) Well yes, because the size and the shape of the mesh is like a box. So it's not correct.

2) So i have no idea. Sorry.
Posted By: Ralph

Re: Physic do some strange things - 04/27/09 18:26

Here is a better Screenshot with the bounding box.

Click on the picture to enlarge it.
Posted By: XD1v0

Re: Physic do some strange things - 04/30/09 16:38

Ralph did you change ph_fps_max_lock variable in code?
Or maybe you set wrong factors for physics collision contact points ph_setcollisions?
© 2023 lite-C Forums