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 / Frictionless space physics

Author
Message
Mcine
8
Years of Service
User Offline
Joined: 9th Jan 2016
Location:
Posted: 17th Jan 2016 13:23
Hey,

How can I do frictionless physics for my spacegame ?
I have zeroed the gravity and sprite frictions.
I have 2 sprites joined with distancejoint and other sprite is static.
When I give the dynamic sprite an impulse (upwards), it will rotate around the static one, but the movement keeps getting slower.
How can I remove all frictions, so that the velocity is constant.

- McIne
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jan 2016 22:24
Look at the SetSpritePhysicsRestitution and SetSpritePhysicsDamping commands in addition to the SetSpritePhysicsFriction that I suspect you are using.

The first sets the bounciness and the second is the one that will cause something to slow down.
Cheers,
Ancient Lady
Mcine
8
Years of Service
User Offline
Joined: 9th Jan 2016
Location:
Posted: 1st Feb 2016 13:25
Thanks for the answer. I need to check all those through.
I think I have damping and friction set to 0, but have not set restitution since I thought it would not matter.
Mcine
8
Years of Service
User Offline
Joined: 9th Jan 2016
Location:
Posted: 1st Feb 2016 19:05
That did not help..

I create the sprites like this (one static and one dynamic)
SetSpriteSize(p1,50,50)
SetSpritePositionByOffset(p1,300,300)
setspritephysicson (p1, 2)
SetSpriteShapeCircle(p1,0,0,25)
SetSpritePhysicsFriction(p1,0)
SetSpritePhysicsDamping(p1,0)
SetSpritePhysicsMass(p1,1)
SetSpritePhysicsRestitution (p1,1)

And I create a distance joint between them and put other in motion and it slows down.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 3rd Feb 2016 11:33
You could cheat with a Joint Motor:



V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Feb 2016 02:43
And it might be possible that the 'SetSpritePhysicsMass(p1,1)' command is resetting the Friction and Damping. Try moving it to just after the 'SetSpriteSize(p1,50,50)' call.
Cheers,
Ancient Lady

Login to post a reply

Server time is: 2024-04-23 15:22:34
Your offset time is: 2024-04-23 15:22:34