bounce with push?

Posted By: Anonymous

bounce with push? - 07/30/08 11:54

Please help - i get stuck...

Using bounce is great to rebound from objects. (it't the resulting vector for the moved object)

But what is the pushing vector of the hit object when bouncing against movable objects?
(maybe yet calculated with the friction?)
(it's not the move vector nor the inverted bounce vector)



Can someone help me calculating the green vector please...
Posted By: Anonymous

Re: bounce with push? - 07/31/08 05:36

solved
Posted By: NITRO777

Re: bounce with push? - 07/31/08 16:27

Quote:
solved
What is it? You should probably post the answer so that others who are searching can find out. I also am curious.
Posted By: MrCode

Re: bounce with push? - 08/01/08 07:10

I think (if you wanted to be completely accurate)that after the ball bounces, you would assign the box's vector the value of the ball's initial vector (from before the bounce), only with a lesser factor (because in real physics, you would be transferring some of the ball's energy to the box, but not all of it). Then you would slow the box down according to whatever friction value you give it.

If you want some good realistic bouncing behavior like this without having to deal with a lot of the math, I would seriously consider using the physics engine.
Posted By: Anonymous

Re: bounce with push? - 08/01/08 07:31

Code:
if(event_type==EVENT_IMPACT){		
	move_friction=.5;

	// pushed force
	vec_set(temp, you._forcex * my._bouncyness);
	vec_normalize(temp, 2 * move_friction);
	
	// added by normal force
	temp.x=(temp.x + normal.x)/2;
	temp.y=(temp.y + normal.y)/2;
	
	my._forcex=temp.x;
	my._forcey=temp.y;
	
	you._forcex=bounce.x;
	you._forcey=bounce.y;
}



Posted By: NITRO777

Re: bounce with push? - 08/01/08 13:47

Thats interesting, thanks!
© 2024 lite-C Forums