Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Inertia Movement for Space Flight (DBC) ?

Author
Message
Newbie5UK
20
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 6th Feb 2006 16:38
Being useless at maths and a newbie, was wondeering if anyonme could help with inertia for movement of an object in space ?

I have DBC and want to apply inertia to an oject after say a thruster burn...

Any code or help appreciated. thx
GameKit
22
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 6th Feb 2006 17:46
Try storing the previous X/Y/Z position of the object as a variable, then moving the object the same amount and direction it moved last.

Try something like...


I'm not sure if this will get you the results you want, but try it anyways. If the inertia is more than you want, divide the x/y/zchange# variables to get a smaller effect.

Well... I hope I helped...



The computer isn't an addiction; it's more of a mental and social dependency.
StevetS
21
Years of Service
User Offline
Joined: 19th May 2004
Location:
Posted: 14th Feb 2006 01:29
When a movement key is pressed you want to change the speed of an object rather than its actual position in space. Use a range of values eg. -50 to +50 for each of the x,y,z directions so pressing a key in the opposite direction gradually slows the object down before changing its direction.

Theres a few posts lurking around demonstrating it - do a search for momentum, interia or gravity.

Hope this helps.

Login to post a reply

Server time is: 2025-05-23 16:53:31
Your offset time is: 2025-05-23 16:53:31