Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, howardR), 472 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
firing using phent_addcentralforce ?? #248242
01/25/09 15:45
01/25/09 15:45
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
I have a simple function that uses phent_addcentralforce() to fire an object. I want to fire it from a FPS view ie from the camera. I just can't figure it out.

Does anyone have some code for this please ?

Thanks

Drac.

Re: firing using phent_addcentralforce ?? [Re: dracula] #248245
01/25/09 16:07
01/25/09 16:07
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
create your bullet in camera position, little bit in front of it and then apply force to the bullet. it should be that simple wink



Ubi bene, ibi Patria.
Re: firing using phent_addcentralforce ?? [Re: croman] #248252
01/25/09 16:38
01/25/09 16:38
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
I can do this but when I pan or tilt the camera, the bullet fires from the orginal position.

Can someone please give me some code to work with.


Thanks

Re: firing using phent_addcentralforce ?? [Re: dracula] #248290
01/25/09 20:43
01/25/09 20:43
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
This is more tricky than you think because c_trace (as I have used before) uses a direction vector where as phent_addcentralforce uses force.
Also, I am not using a model, just the camera co-ordinates

Thanks

Drac.

Re: firing using phent_addcentralforce ?? [Re: dracula] #248323
01/26/09 02:08
01/26/09 02:08
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Remember to rotate your antity and phent_addcentralforce vector
by the cameras pan, tilt, and maybe roll?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: firing using phent_addcentralforce ?? [Re: EvilSOB] #248384
01/26/09 15:08
01/26/09 15:08
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Good idea, sadly I still can't do it.

Thanks

Re: firing using phent_addcentralforce ?? [Re: dracula] #248385
01/26/09 15:17
01/26/09 15:17
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Hi there,
You have to use "phent_addvellocal" instead of "phent_addcentralforce".

This will add force dependent to the bullets orientation (pan, tilt, roll).

cheers

Zwecklos

Re: firing using phent_addcentralforce ?? [Re: zwecklos] #248416
01/26/09 19:20
01/26/09 19:20
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Hi Zwecklos

It worked perfectly, thank you so much !

Drac.


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