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.

Newcomers DBPro Corner / Math & C++ to Basic

Author
Message
Zigma
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 9th Feb 2003 09:38
Hey

I'm an coder noob..........
I'm trying to do some math in DBC. that i read from C++ code

It works fine, until this c++ line:
c++: car->position_wc.y += delta_t * car->velocity_wc.y;

and i try this in DBC:

car_pos_wc_z# = delta_t# * car_vel_wc_z#

_
What confuses me is " += " in the C++ line

I will be glad if some now how to do this.......
I'm glose to some interesting carphysics that will be open source when it works fine.

Thanks
Deegeebee
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location:
Posted: 9th Feb 2003 12:23
Hello There, The += in the C++ code means add delta_t*car->velocity_wc.y to car->position_wc.y

so, in DB you need...

car_pos_wc_z# = car_pos_wc_z# + delta_t#*car_vel_wc_z#
Zigma
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 9th Feb 2003 20:11
Thx


That worked fine.
And now i ceap on coding untill next problem.......
Zigma
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 10th Feb 2003 00:20
hello
Well here is a new math prob. I cant finde any good exampels
fore math in DB.
Anyway hers some more C++ code

flatf.x = 0;
flatf.y = CA_F * slipanglefront;
flatf.y = MIN(MAX_GRIP, flatf.y);
flatf.y = MAX(-MAX_GRIP, flatf.y);
flatf.y *= weight;
if(front_slip)
flatf.y *= 0.5;

I'm trying to write this in basic, but I dont understand line 3 in C++ code
flatf.y = MIN(MAX_GRIP, flatf.y);

if it means the min value of "max_grip, flat.y"
hove do I do that in basic ?

So any C++/basic gurus please help
Zigma
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 12th Feb 2003 00:12

is my question to stupid or to hard?
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 12th Feb 2003 00:15
In order to use MIN, you will need IanM's plug-in...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 12th Feb 2003 00:17
if you want to finf the minimum of two numbers (say that's a function there)

min(a,b)
if a > b then exitfunction b
endfunction a

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
Zigma
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 12th Feb 2003 05:02

Hello and thx 4 replays.

Is that IanM's plug-in fore DB or DBPro ?
if fore DB. where can I get it?
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 12th Feb 2003 23:52
It can be use with DB (if you have DarkMatter), and with DBPro.

I dont know his web site off by heart, so it might be wise to look for one of his posts.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2024-11-24 03:04:18
Your offset time is: 2024-11-24 03:04:18