问题
Is there any way to disable gravity in Matter.js? I want my objects (bodies) to keep their physical abilities (like reaction to collision, restitution, friction etc), but I'd like to prevent the reaction to device's gyro and orientation change.
回答1:
Try
engine.world.gravity.y = 0;
where engine
is your engine instance.
来源:https://stackoverflow.com/questions/29466684/disabling-gravity-in-matter-js