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,430 guests, and 3 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
bounce with push? #218757
07/30/08 11:54
07/30/08 11:54

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



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...

Re: bounce with push? [Re: ] #218863
07/31/08 05:36
07/31/08 05:36

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



solved

Re: bounce with push? [Re: ] #218998
07/31/08 16:27
07/31/08 16:27
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline
Expert
NITRO777  Offline
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
Quote:
solved
What is it? You should probably post the answer so that others who are searching can find out. I also am curious.

Re: bounce with push? [Re: NITRO777] #219127
08/01/08 07:10
08/01/08 07:10
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline
User
MrCode  Offline
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
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.

Last edited by MrCode; 08/01/08 07:19.

Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: bounce with push? [Re: NITRO777] #219131
08/01/08 07:31
08/01/08 07:31

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



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;
}




Re: bounce with push? [Re: ] #219225
08/01/08 13:47
08/01/08 13:47
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline
Expert
NITRO777  Offline
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
Thats interesting, thanks!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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