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
3 registered members (TipmyPip, AndrewAMD, dBc), 18,430 guests, and 6 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
accelerate problem #364521
03/18/11 22:05
03/18/11 22:05
Joined: Apr 2009
Posts: 141
dakilla Offline OP
Member
dakilla  Offline OP
Member

Joined: Apr 2009
Posts: 141
hey, I have used accelerate and vec_accelerate a lot recently however I am completely frustrated with it in this occasion. Is it that I cannot use vec_accelerate and accelerate in the same function? - I cannot see a reason why not, however when I try and use this code:

var aspeed = 0;
vec_add(camera.pan,accelerate(aspeed,0,0));

The variable aspeed switches between 9 and -9 within every second and the camera pans all over the place. Notice that there is no input into the acceleration function and no friction, so all i would expect is there to be no camera movement. If it means anything, in the same function I am using vec_accelerate but all of the variables and vectors have different names.

Thanks for any helps


One day there will be an unfixable bug,
That day is not today.
Re: accelerate problem [Re: dakilla] #364524
03/18/11 22:13
03/18/11 22:13
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
you can use vec_accelerate and accelerate as often in as many function as you like.

I am sorry, but "vec_add(camera.pan,accelerate(aspeed,0,0));" is nonsense. vec_add expects two vectors. Accelerate returns the distance to cover in quants, i.e. a scalar. I guess the other two missing vector elements will be random memory from the stack in your case. Apart from that: calling accelerate with a friction and an acceleration of 0 does not make any sense.


Always learn from history, to be sure you make the same mistakes again...

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