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.

AppGameKit Studio Chat / SetObject3DPhysicsCanSleep() problem

Author
Message
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 10th Mar 2019 12:04 Edited at: 10th Mar 2019 14:11
Trying to do a golf game,3D, using the physics within the engine I coded, the problem is, I have to set the cansleep() to 0 so the ball remains active, this causes another problem,as when i read out the velocity of the ball at anytime it seems to never be zero,so i am guessing if you set sleep to 0 then a random +- value gets fed to the x,y,z velocities, very small values!
But how do i tell with that, that the player can shoot again, ideally i wanna check if the x,y,z velocities are zero, but they never are!
Edit** damnit.. wrong chat board
Hail to the king, baby!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Mar 2019 19:26
I would round the numbers down to maybe two or three decimal places.

x = Round(x * 100.0) / 100 // Two decimal
x = Round(x * 1000.0) / 1000 // Three decimal

Login to post a reply

Server time is: 2024-03-28 09:22:51
Your offset time is: 2024-03-28 09:22:51