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 AppGameKit Corner / SetObjectlinearVelocity doesn't seem to work once an object has come to rest

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Jul 2016 06:50 Edited at: 13th Jul 2016 06:50
Like the title says. Run the code, hit the up arrow to move the block then wait until it has come to a complete rest. After that the object no longer responds to SetObjectlinearVelocity
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Jul 2016 10:52 Edited at: 13th Jul 2016 10:53
It might just be that the object is allowed to sleep, you can disable sleeping with a command like Set3DPhysicsObjectCanSleep, then the objects physics shouldn't switch off - it's a shame we can't automatically wake up an object by specifying it's velocity.
The code is dark and full of errors
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 13th Jul 2016 19:42
The way it was setup was to give you full control. If you want to apply a force to a
dynamic object you must wake it up first. Then you decided when you want to put it to sleep.
That way all dynamic objects are put to sleep automatically by the physics engine unless you
decide otherwise. In conclusion if the SetObject3DPhysicsLinearVelocity command automatically
woke up the object and then applied the velocity you would not know it was stuck awake and would never go
back under the control of the physics engines sleep mode.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Jul 2016 21:03
I see, thanks for the explanation, makes sense.
The code is dark and full of errors
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Jul 2016 00:18
thanks for the responses guys. i appreciate it

Login to post a reply

Server time is: 2024-11-22 02:14:20
Your offset time is: 2024-11-22 02:14:20