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 / Turn Gravity Off

Author
Message
Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 26th Apr 2006 22:34 Edited at: 26th Apr 2006 22:34
Hi, i am trying to make it so you can turn the gravity off in ODE, i am pretty sure this should work but it doesn't and i am a little stuck, any help appreciated.




-Adam
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 26th Apr 2006 23:35
Are you trying to make it so that when you hit the spacekey the gravity will begin. Well, one problem is that when you hit the spacekey it sets the variable grav# to -9.81 but then never does anything with that variable.

Thank you for using functions by the way. This code works for me if it is what you wanted to do. I don't know if it is the best way to do this but it is the only way I know.



Insanity is just a state of mind
Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 26th Apr 2006 23:49 Edited at: 26th Apr 2006 23:51
what functions?
I quickly made these up along with a couple of others earlier today, if i knew you had done them i would have stolen yours
link?


This is what i assumed would happen;
i assigned the grav# variable to the gravity# value in the function, then change it from grav#=0 to grav#=-9.81, so it doesn't really turn it off, it just changes the value to stop it falling down, this didn't work for me so i thought there would be another way, that way is a bit impracticle because i'm going to have to have many objects that it would have to affect, plus, my you can pull objects around and place them so i would have to affect the gravity globally...

Oh yeah, just out of curiousity what do
ode set world step
ode set world erp
ode set world cfm
they do, i can't make head or tail of the C++ code and i stole the values from here http://forum.thegamecreators.com/?m=forum_view&t=76973&b=6 , not entirely sure what they mean...

cheers anyway
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 27th Apr 2006 03:56 Edited at: 27th Apr 2006 03:56
Quote: "
Thank you for using functions by the way.
"


I was thanking you for making different actions into functions. I haven't made ode functions myself. If you look at what I put as a possible solution you will see that I have to call the one which makes the dynamic box. It would have been so much more annoying to have to figure out what values you initially used.

As for the commands you asked about, I am not sure. I have been using the values that are in the example with the ode. Hopefully someone can answer this because I am curious.

Insanity is just a state of mind
Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 27th Apr 2006 22:30
ah sorry, read it wrong, i have got it to turn the gravity off completely but it inherits the force it originally got from the fall and just bounces back, i think i may have to add a force to the opposite direction it is travelling to stop it...
Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 28th Apr 2006 18:48
i hate to double post but i see no reason in making a new thread.

I have been trying to get it so it makes a new cube when i press a button, i am using ODE so i don't want it to make a new cube in another object so i tried to code it so it places them away from everything else but it won't work...


all i am then doing is saying


anyone know where i am going wrong?

Login to post a reply

Server time is: 2024-11-27 20:39:47
Your offset time is: 2024-11-27 20:39:47