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.

Dark GDK / Bound object to floor?

Author
Message
Tav
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location:
Posted: 28th Aug 2008 15:13 Edited at: 28th Aug 2008 15:13
Hey

Sorry for all the questions. But how do I keep a object on the floor? I already have camera and object collision so my object won't walk trough walls. Yet he still hovers.
Main.cpp

Player.h
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 29th Aug 2008 21:57
so you want to accellerate ur man downwards by 9.8 m/s2 until he hits the floor, and stop him. should be very similar to the code used for movement. Also, if u create an update function for your object, it makes code much neater than this sort of thing:

*Knight->x = dbObjectPositionX(1);
*Knight->y = dbObjectPositionY(1);
*Knight->z = dbObjectPositionZ(1);
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 29th Aug 2008 22:08
Why are you using dynamic memory for everything? It's totally unnecessary.

Tav
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location:
Posted: 30th Aug 2008 14:41
About the dynamic memory question, I just finished a tutorial about c++ and wanted to try it :p. Thanks for the replies.
Tav
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location:
Posted: 30th Aug 2008 14:54
Quote: "So you want to accellerate ur man downwards by 9.8 m/s2 until he hits the floor, and stop him. "
How do I know the height of the floor?
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 31st Aug 2008 08:06
You don't. Use collision.
Tav
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location:
Posted: 31st Aug 2008 14:07
Thanks Zuka.

Login to post a reply

Server time is: 2024-09-30 05:29:37
Your offset time is: 2024-09-30 05:29:37