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 (AndrewAMD), 1,310 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Physics Explosion #244874
01/07/09 11:04
01/07/09 11:04
Joined: Jul 2008
Posts: 54
Taipei, Taiwan
PlaystationThree Offline OP
Junior Member
PlaystationThree  Offline OP
Junior Member

Joined: Jul 2008
Posts: 54
Taipei, Taiwan
I posted this already in the physics forum but nobody gave any good suggestions so I'm posting again here.

Is there any way to c_scan from a position in the world (i.e. the point of the explosion), then in the entitys' EVENT_SCAN event calculate the distance and direction from the explosion point to my.x, then calculate the correct force that needs to be applied according to the distance then use phent_addcentralforce(); or some other one of those functions to apply it in the right direction. I know there would be lots of trig and vector math involved, and I would figure it out myself, but I'm just starting highschool so obviously haven't learned that yet.


Bet you don't know where Taiwan is lol.

"The Lord is my light and my salvation..." Psm 27:1
Re: Physics Explosion [Re: PlaystationThree] #244900
01/07/09 13:11
01/07/09 13:11
Joined: Oct 2008
Posts: 24
Germany
H
Hazardos Offline
Newbie
Hazardos  Offline
Newbie
H

Joined: Oct 2008
Posts: 24
Germany
something like this

VECTOR* tmp = vec_position;
vec_sub (tmp, vec_explosion);
vec_length (tmp) //gives now the distance from position to explosion, use this as the force as you want

Re: Physics Explosion [Re: Hazardos] #245016
01/08/09 00:48
01/08/09 00:48
Joined: Jul 2008
Posts: 54
Taipei, Taiwan
PlaystationThree Offline OP
Junior Member
PlaystationThree  Offline OP
Junior Member

Joined: Jul 2008
Posts: 54
Taipei, Taiwan
Thanks Hazardos. That's simple enough stuff, but that only give the distance. All the physics functions that add force to an object also need a direction vector in world coordinates, which is what's got me stumped.


Bet you don't know where Taiwan is lol.

"The Lord is my light and my salvation..." Psm 27:1

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