deltaluca / nape

Haxe/AS3 Physics Engine
http://napephys.com
Other
542 stars 77 forks source link

Material.dynamicFriction ignored in gravity-less space #106

Closed neuronix closed 8 years ago

neuronix commented 8 years ago

Hi,

If a space has a 0,0 gravity vector, dynamicFriction is ignored. Here is another user reporting the issue (https://groups.google.com/forum/?fromgroups=#!searchin/nape-physics/dynamicFriction/nape-physics/d3brtbDNlVU/0h8ihwk9ryIJ)

If there any chance this could be fixed? Or is there a workaround?

Regards,

Nx

deltaluca commented 8 years ago

Not a bug. if the body is not actively colliding with something, why would there ever be any friction to slow it down?

if what you're after is a top-down sort of physics where the 'background' is always being "collided" against, as it were, your best bet if you want a 2d physics engine is to use drag (can do it manually, scaling the velocity of the body down each frame as you like) or for more fun mechanics, placing a big fluid body over the world which will give you some degree of approximated aerodynamic effects

neuronix commented 8 years ago

Thanks for the explanation, it does indeed make sense. However the decriptions for dynamic & static friction feel a bit misleading, reading them I would have expected them to work a bit like linear & angular drag allowing custom drag values for each material: "The higher this value the more quickly objects will slow down from speed when sliding." Would maybe reformulate to: "The higher this value the more quickly objects with this material will slow down from speed when sliding against other objects.".

I'm currently just using the world drag properties, might give the fluid idea a try.

Thanks for your help and for Nape, it's a great API :)

MSGhero commented 8 years ago

"placing a big fluid body over the world which will give you some degree of approximated aerodynamic effects" wow I never thought to do that