Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 1,012 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vector problem #253479
02/24/09 22:28
02/24/09 22:28
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
Hi,

I have the following problem:

what is the difference between:

vec_set (vector1.x, vector (1,2,3));

and

vec_set (vector1.y, vector (1,2,3));

is it not enough to use the first one if i want to include the whole "vector (1,2,3)" into "vector1"? But there is a different result when i use the second example? what is this difference?


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: vector problem [Re: MPQ] #253482
02/24/09 23:14
02/24/09 23:14
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline
Member
Nicotin  Offline
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
The difference is that

vec_set (vector1.y, vector (1,2,3));

is wrong.

vec_set (vector1.x, vector (1,2,3));

does:

vector1.x = 1;
vector1.y = 2;
vector1.z = 3;

You ever have to use the first value. Same for pan:
vec_set (entity.pan, vector (1,2,3));
and not
vec_set (entity.roll, vector (1,2,3));

If you use the vector1.y then you get another value because the engine makes really odd things with this^^

Last edited by Nicotin; 02/24/09 23:16.


Re: vector problem [Re: Nicotin] #253536
02/25/09 11:10
02/25/09 11:10
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
yes i already noticed that^^


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: vector problem [Re: MPQ] #253820
02/27/09 04:33
02/27/09 04:33
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Crudely put... and not NECESSARY to know.
Code:
vec_set(vector1.x, vector (1,2,3));
        +---+---+---+----------------+
vector()| X | Y | Z | temp space           << somewhere in memory
          |   |   |
vec_set   |   |   |
          v   v   v
vector1 | X | Y | Z | other variable |     << somewhere else in memory
Becomes
vector()| 1 | 2 | 3 | temp space           << somewhere in memory
          |   |   |
vec_set   |   |   |
          v   v   v
vector1 | 1 | 2 | 3 | other variable |     << somewhere else in memory
All good.

BUT when

vec_set (vector1.y, vector (1,2,3)); 
        +---+---+---+----------------+
vector()    | X | Y | Z | temp space       << somewhere in memory
              |   |   |
vec_set       |   |   |
              v   v   v
vector1 | X | Y | Z | other variable |     << somewhere else in memory
becomes
vector()    | 1 | 2 | 3 | temp space       << somewhere in memory
              |   |   |
vec_set       |   |   |
              v   v   v
vector1 | ? | 1 | 2 | ??? other variable | << somewhere else in memory
vector1.x remains unchanged, but the "other variable" gets damaged.
Hope this helps.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

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