Gamestudio Links
Zorro Links
Newest Posts
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
Camera always moves upwards?
by NeoDumont. 11/14/25 16:32
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (AndrewAMD), 8,508 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
tritom, sheliepaley, Blueguy, blobplayintennis, someone2
19178 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Basic offsetting?? #252150
02/16/09 20:24
02/16/09 20:24
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
I've had this problem for a while, always just made a cheap version that never really worked.

How do I offset a entity like a bullet slightly infront of anouther entity like the player reletive to the players pan?

Re: Basic offsetting?? [Re: RyuShinji] #252183
02/16/09 23:19
02/16/09 23:19
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
just do some math...

or do it the lazy way:
[code]
vec_for_angle(temp,player.pan);
// get unity vector out of player.pan
vec_scale(temp, 100);
// and extend him 100 quants
[\code]
this code sets temp 100 quants infront of the player entity

Re: Basic offsetting?? [Re: RyuShinji] #252232
02/17/09 09:34
02/17/09 09:34
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
Here's another version that allows you to set offsets on all the axis:

vec_set (bullet.x, vector (100, -50, 20)); // place the bullet 100 quants in front, 50 quants sideway, 20 quants above the origin
vec_rotate (bullet.x, player.pan);
vec_add (bullet.x, player.x);
bullet.pan = player.pan;


Gamestudio download | 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