Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, Ayumi, 7th_zorro), 877 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
particle + bounce ? #385966
10/26/11 12:18
10/26/11 12:18
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline OP
Serious User
darkinferno  Offline OP
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
i'm trying to use bounce/vec_bounce along with particles, am not sure how to accomplish this, i know i cant just write:


vec_bounce(p.vel_x, p.vel_x);

also what if i wanted to trace along the path a particle is moving, meaning, i want to trace from the current particle position to a position infront of it based on its velocity; ive tried calculating it using the distance covered this frame and last frame but i think i overlooked something....

Re: particle + bounce ? [Re: darkinferno] #385967
10/26/11 12:51
10/26/11 12:51
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Well, I would simply do the following:

A) save current position in a temporary vector
B) calculate new position according to vel_x and time_step
C) use temporary vector and new x,y,z position to trace
D) if you hit something, place particle to the hit x,y,z position and set velocity parameters to the bounce direction

Nevertheless, I could imagine that if you do this for each particle, your game could get awfully slow.

PhysX has particle fluids, though, this is not yet ported to Gamestudio. So, if you need a high performance and physically correct solution, try that.


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