Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (Dico), 16,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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